-
Notifications
You must be signed in to change notification settings - Fork 134
/
TestModel.cs
60 lines (49 loc) · 1.84 KB
/
TestModel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
using System;
namespace GridBlazor.Tests
{
public class TestModel
{
public int Id { get; set; }
public string Title { get; set; }
public DateTime Created { get; set; }
public TestModelChild Child { get; set; }
public TestModelChild[] List { get; set; }
public Int16 Int16Field { get; set; }
public UInt16 UInt16Field { get; set; }
public UInt32 UInt32Field { get; set; }
public UInt64 UInt64Field { get; set; }
public Guid GuidField { get; set; }
public TestEnum EnumField { get; set; }
public override bool Equals(object obj)
{
var compareObject = obj as TestModel;
if (compareObject == null) return false;
return compareObject.Created == Created
&& compareObject.Id == Id
&& compareObject.Title == Title
&& compareObject.Child.ChildCreated == Child.ChildCreated
&& compareObject.Child.ChildTitle == Child.ChildTitle
&& compareObject.Int16Field == Int16Field
&& compareObject.UInt16Field == UInt16Field
&& compareObject.UInt32Field == UInt32Field
&& compareObject.UInt64Field == UInt64Field
&& compareObject.GuidField == GuidField
&& compareObject.EnumField == EnumField;
}
public override int GetHashCode()
{
return new { Id, Title, Child.ChildCreated, Child.ChildTitle, Int16Field, UInt16Field, UInt32Field, UInt64Field, GuidField, EnumField }.GetHashCode();
}
}
public class TestModelChild
{
public string ChildTitle { get; set; }
public DateTime ChildCreated { get; set; }
}
public enum TestEnum
{
Foo,
Bar,
Baz,
}
}