- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for AssertObjEqual (0.15 sec)
-
tests/scanner_valuer_test.go
} if result.ExampleStruct.Val != "value1" { t.Errorf(`ExampleStruct.Val should equal to "value1", but got %#v`, result.ExampleStruct) } AssertObjEqual(t, data, result, "Name", "Gender", "Age", "Male", "Height", "Birthday", "Password", "Bytes", "Num", "Strings", "Structs") } func TestScannerValuerWithFirstOrCreate(t *testing.T) {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Jun 07 07:02:07 UTC 2023 - 10.6K bytes - Viewed (0) -
tests/update_test.go
return result2.Toys[i].ID < result2.Toys[j].ID }) AssertObjEqual(t, result2, result, "Name", "Account", "Toys", "Manager", "ManagerID", "Languages") DB.Model(&result).Select("Name", "Age").Updates(User{Name: "update_with_select"}) if result.Age != 0 || result.Name != "update_with_select" { t.Fatalf("Failed to update struct with select, got %+v", result) } AssertObjEqual(t, result, user, "UpdatedAt") var result3 User
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Dec 04 03:50:58 UTC 2023 - 30.3K bytes - Viewed (0) -
tests/associations_test.go
parent.FavChildID = child.ID parent.FavChild = &child DB.Save(&parent) var parent1 Parent DB.First(&parent1, parent.ID) AssertObjEqual(t, parent, parent1, "ID", "FavChildID") // Save and Updates is the same DB.Updates(&parent) DB.First(&parent1, parent.ID) AssertObjEqual(t, parent, parent1, "ID", "FavChildID") } func TestSaveHasManyCircularReference(t *testing.T) { parent := Parent{}
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Feb 08 08:29:09 UTC 2023 - 10.9K bytes - Viewed (0) -
tests/hooks_test.go
if err := DB.First(&resultClone, "name = ?", "Nice_clone").Error; err != nil { t.Fatalf("Failed to find cloned product, got error: %v", err) } result.Price *= 2 result.Name += "_clone" AssertObjEqual(t, result, resultClone, "Price", "Name") DB.Model(&result).Update("Price", 500) var result2 Product2 DB.First(&result2, "name = ?", "Nice") if result2.Price != 500 {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Jun 17 03:59:06 UTC 2024 - 16.7K bytes - Viewed (0) -
tests/create_test.go
t.Fatalf("failed to create, got error %v", err) } newProd := &CompositeKeyProduct{} if err := DB.First(&newProd).Error; err != nil { t.Fatalf("errors happened when query: %v", err) } else { AssertObjEqual(t, newProd, prod, "ProductID", "LanguageCode", "Code", "Name") } } func TestCreateOnConflictWithDefaultNull(t *testing.T) { type OnConflictUser struct { ID string
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Tue Mar 19 03:50:28 UTC 2024 - 26.4K bytes - Viewed (0)