@@ -46,12 +46,22 @@ struct Point
46
46
{
47
47
public int X ;
48
48
public int Y ;
49
+ public Point ( int x , int y )
50
+ {
51
+ X = x ;
52
+ Y = y ;
53
+ }
49
54
}
50
55
51
56
struct Rect
52
57
{
53
58
public Point UpperLeft ;
54
- public Point BottonRight ;
59
+ public Point BottomRight ;
60
+ public Rect ( Point upperLeft , Point bottomRight )
61
+ {
62
+ UpperLeft = upperLeft ;
63
+ BottomRight = bottomRight ;
64
+ }
55
65
}
56
66
57
67
[ Test ]
@@ -78,7 +88,7 @@ public void TestNullToValueTypes()
78
88
79
89
Assert . AreEqual ( default ( Rect ) , Decode < Rect > ( NullV . Instance ) ) ;
80
90
Assert . AreEqual ( default ( Rect ) , Decode < Rect > ( ObjectV . Empty ) ) ;
81
- Assert . AreEqual ( default ( Rect ) , Decode < Rect > ( ObjectV . With ( "UpperLeft" , NullV . Instance , "BottonRight " , NullV . Instance ) ) ) ;
91
+ Assert . AreEqual ( default ( Rect ) , Decode < Rect > ( ObjectV . With ( "UpperLeft" , NullV . Instance , "BottomRight " , NullV . Instance ) ) ) ;
82
92
83
93
//
84
94
@@ -214,6 +224,11 @@ public override bool Equals(object obj)
214
224
Created == product . Created &&
215
225
LastUpdated == product . LastUpdated ;
216
226
}
227
+
228
+ public override int GetHashCode ( )
229
+ {
230
+ return base . GetHashCode ( ) ;
231
+ }
217
232
}
218
233
219
234
[ Test ]
@@ -369,7 +384,7 @@ class MissingPropertiesOnConstructor
369
384
public string Field1 { get ; set ; }
370
385
371
386
[ FaunaField ( "a_missing_field" ) ]
372
- string field2 ;
387
+ string field2 = default ( string ) ;
373
388
374
389
public string Field2 { get { return field2 ; } }
375
390
@@ -399,7 +414,7 @@ class MissingPropertiesOnMethodCreator
399
414
public string Field1 { get ; set ; }
400
415
401
416
[ FaunaField ( "a_missing_field" ) ]
402
- string field2 ;
417
+ string field2 = default ( string ) ;
403
418
404
419
public string Field2 { get { return field2 ; } }
405
420
@@ -701,13 +716,24 @@ struct NestedStruct
701
716
{
702
717
public byte ? aByte ;
703
718
public short ? aShort ;
719
+ public NestedStruct ( byte ? abyte , short ? ashort )
720
+ {
721
+ aByte = abyte ;
722
+ aShort = ashort ;
723
+ }
704
724
}
705
725
706
726
struct StructWithNullableFields
707
727
{
708
728
public int ? anInteger ;
709
729
public double ? aDouble ;
710
730
public NestedStruct ? aStruct ;
731
+ public StructWithNullableFields ( int ? intVal , double ? doubleVal , NestedStruct ? structVal )
732
+ {
733
+ anInteger = intVal ;
734
+ aDouble = doubleVal ;
735
+ aStruct = structVal ;
736
+ }
711
737
}
712
738
713
739
[ Test ]
0 commit comments