Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneZsng committed Apr 8, 2022
1 parent a0808ee commit 894a05e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions force_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,28 @@ func TestClient_Query2(t *testing.T) {
}
}

func TestClient_Query3(t *testing.T) {
client := requireClient(t, true)

q := "SELECT Id FROM CaseComment WHERE CommentBody = 'This comment is created by simpleforce & used for testing'"
result, err := client.Query(q)
if err != nil {
log.Println(logPrefix, "query failed,", err)
t.FailNow()
}

log.Println(logPrefix, result.TotalSize, result.Done, result.NextRecordsURL)
if result.TotalSize < 1 {
log.Println(logPrefix, "no records returned.")
t.FailNow()
}
for _, record := range result.Records {
if record.Type() != "CaseComment" {
t.Fail()
}
}
}

func TestClient_ApexREST(t *testing.T) {
client := requireClient(t, true)

Expand Down
2 changes: 1 addition & 1 deletion sobject_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func TestSObject_Create(t *testing.T) {
// Positive 2
caseComment1 := client.SObject("CaseComment")
caseComment1Result := caseComment1.Set("ParentId", case1Result.ID()).
Set("CommentBody", "This comment is created by simpleforce").
Set("CommentBody", "This comment is created by simpleforce & used for testing").
Set("IsPublished", true).
Create()
if caseComment1Result.Get().SObjectField("Case", "ParentId").ID() != case1Result.ID() {
Expand Down

0 comments on commit 894a05e

Please sign in to comment.