Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 8 of 8 for AssertObjEqual (0.11 sec)

  1. tests/helper_test.go

    			t.Fatalf("errors happened when query: %v", err)
    		} else {
    			AssertObjEqual(t, newPet, pet, "ID", "CreatedAt", "UpdatedAt", "DeletedAt", "UserID", "Name")
    			AssertObjEqual(t, newPet, expect, "ID", "CreatedAt", "UpdatedAt", "DeletedAt", "UserID", "Name")
    		}
    	}
    
    	AssertObjEqual(t, pet, expect, "ID", "CreatedAt", "UpdatedAt", "DeletedAt", "UserID", "Name")
    
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Tue Mar 19 03:50:28 UTC 2024
    - 8K bytes
    - Viewed (0)
  2. schema/constraint_test.go

    		},
    	}
    	for k, result := range results {
    		v, ok := constraints[k]
    		if !ok {
    			t.Errorf("Failed to found unique constraint %v from parsed constraints %+v", k, constraints)
    		}
    		tests.AssertObjEqual(t, result, v, "Name")
    		tests.AssertObjEqual(t, result.Field, v.Field, "Name", "Unique", "UniqueIndex")
    	}
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Sun Feb 04 07:49:19 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  3. schema/index_test.go

    				return
    			}
    			tests.AssertObjEqual(t, ai, ei, "Name", "Class", "Type", "Where", "Comment", "Option")
    			if len(ei.Fields) != len(ai.Fields) {
    				t.Errorf("expected index %q field length is %d but actual %d", k, len(ei.Fields), len(ai.Fields))
    				return
    			}
    			for i, ef := range ei.Fields {
    				af := ai.Fields[i]
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Sun Feb 04 07:49:19 UTC 2024
    - 8K bytes
    - Viewed (0)
  4. 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)
  5. schema/schema_helper_test.go

    	"gorm.io/gorm/schema"
    	"gorm.io/gorm/utils/tests"
    )
    
    func checkSchema(t *testing.T, s *schema.Schema, v schema.Schema, primaryFields []string) {
    	t.Run("CheckSchema/"+s.Name, func(t *testing.T) {
    		tests.AssertObjEqual(t, s, v, "Name", "Table")
    
    		for idx, field := range primaryFields {
    			var found bool
    			for _, f := range s.PrimaryFields {
    				if f.Name == field {
    					found = true
    				}
    			}
    
    			if idx == 0 {
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Fri Dec 15 08:31:23 UTC 2023
    - 7.5K bytes
    - Viewed (0)
  6. tests/query_test.go

    		t.Fatalf("Failed to query smaller user, got error %v", err)
    	}
    
    	AssertObjEqual(t, user, simpleUser, "Name", "ID", "UpdatedAt", "CreatedAt")
    
    	var simpleUser2 SimpleUser
    	if err := DB.Model(&User{}).Select("id").First(&simpleUser2, user.ID).Error; err != nil {
    		t.Fatalf("Failed to query smaller user, got error %v", err)
    	}
    
    	AssertObjEqual(t, user, simpleUser2, "ID")
    
    	var simpleUsers []SimpleUser
    Registered: Sun Nov 03 09:35:10 UTC 2024
    - Last Modified: Mon Jun 24 09:42:59 UTC 2024
    - 50.4K bytes
    - Viewed (0)
  7. 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)
  8. 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)
Back to top