- Sort Score
- Result 10 results
- Languages All
Results 851 - 860 of 880 for assertEquals (0.16 sec)
-
tests/migrate_test.go
err = DB.AutoMigrate(&ArrayTypeModel{}) AssertEqual(t, nil, err) ct, err := findColumnType(&ArrayTypeModel{}, "number") AssertEqual(t, nil, err) AssertEqual(t, "varchar", ct.DatabaseTypeName()) ct, err = findColumnType(&ArrayTypeModel{}, "text_array") AssertEqual(t, nil, err) AssertEqual(t, "text[]", ct.DatabaseTypeName())
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Mar 18 11:24:16 UTC 2024 - 56.2K bytes - Viewed (0) -
tests/associations_many2many_test.go
AssertEqual(t, nil, err) var findUser1 User err = DB.Preload("Languages").Where("id = ?", user1.ID).First(&findUser1).Error AssertEqual(t, nil, err) AssertEqual(t, user1, findUser1) var findUser2 User err = DB.Preload("Languages").Where("id = ?", user2.ID).First(&findUser2).Error AssertEqual(t, nil, err) AssertEqual(t, user2, findUser2) }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Sat Jun 10 13:05:19 UTC 2023 - 13.2K bytes - Viewed (0) -
tests/distinct_test.go
var names []string DB.Table("users").Where("name like ?", "distinct%").Order("name").Pluck("name", &names) AssertEqual(t, names, []string{"distinct", "distinct", "distinct", "distinct-2", "distinct-3"}) var names1 []string DB.Model(&User{}).Where("name like ?", "distinct%").Distinct().Order("name").Pluck("Name", &names1) AssertEqual(t, names1, []string{"distinct", "distinct-2", "distinct-3"}) var names2 []string
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Thu Jan 06 07:02:53 UTC 2022 - 2.5K bytes - Viewed (0) -
tests/named_argument_test.go
AssertEqual(t, result, namedUser) var result2 NamedUser DB.Where("name1 = @name OR name2 = @name OR name3 = @name", sql.Named("name", "jinzhu2")).First(&result2) AssertEqual(t, result2, namedUser) var result3 NamedUser DB.Where("name1 = @name OR name2 = @name OR name3 = @name", map[string]interface{}{"name": "jinzhu2"}).First(&result3) AssertEqual(t, result3, namedUser)
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Tue Dec 21 11:50:00 UTC 2021 - 2.7K bytes - Viewed (0) -
tests/update_has_one_test.go
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Thu Jul 14 06:55:54 UTC 2022 - 3.6K bytes - Viewed (0) -
tests/joins_test.go
} AssertEqual(t, user1.NamedPet.Name, "joins-on_pet_1") onQuery2 := DB.Where(&Pet{Name: "joins-on_pet_2"}) var user2 User if err := DB.Joins("NamedPet", onQuery2).Where("users.name = ?", user.Name).First(&user2).Error; err != nil { t.Fatalf("Failed to load with joins on, got error: %v", err) } AssertEqual(t, user2.NamedPet.Name, "joins-on_pet_2") }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Jun 17 03:58:13 UTC 2024 - 15K bytes - Viewed (0) -
utils/tests/utils.go
return } got := rv.FieldByName(name).Interface() expect := ev.FieldByName(name).Interface() t.Run(name, func(t *testing.T) { AssertEqual(t, got, expect) }) } } func AssertEqual(t *testing.T, got, expect interface{}) { if !reflect.DeepEqual(got, expect) { isEqual := func() { if curTime, ok := got.(time.Time); ok { format := "2006-01-02T15:04:05Z07:00"
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Mar 10 09:21:56 UTC 2023 - 3.9K bytes - Viewed (0) -
tests/create_test.go
u.Mobile = "" err = DB.Clauses(clause.OnConflict{UpdateAll: true}).Create(&u).Error AssertEqual(t, err, nil) var u2 OnConflictUser err = DB.Where("id = ?", u.ID).First(&u2).Error AssertEqual(t, err, nil) AssertEqual(t, u2.Name, "on-conflict-user-name-2") AssertEqual(t, u2.Email, "on-conflict-user-email-2") AssertEqual(t, u2.Mobile, "133xxxx") } func TestCreateFromMapWithoutPK(t *testing.T) {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Tue Mar 19 03:50:28 UTC 2024 - 26.4K bytes - Viewed (0) -
tests/preload_test.go
if err != nil { t.Errorf("failed to find value, got err: %v", err) } AssertEqual(t, len(finds), 2) AssertEqual(t, finds[0], value1) AssertEqual(t, finds[1], value2) } func TestMergeNestedPreloadWithNestedJoin(t *testing.T) { users := []User{ { Name: "TestMergeNestedPreloadWithNestedJoin-1", Manager: &User{ Name: "Alexis Manager", Tools: []Tools{
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Jun 12 10:00:47 UTC 2024 - 15.9K bytes - Viewed (0) -
tests/serializer_test.go
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Apr 21 14:09:38 UTC 2023 - 7.6K bytes - Viewed (0)