1+ using System ;
12using System . Collections . Generic ;
23
34namespace MemoryPack . Tests . Models ;
@@ -26,14 +27,21 @@ partial class FieldDefaultValue
2627[ MemoryPackable ]
2728partial class PropertyDefaultValue
2829{
30+ internal enum NestedEnum
31+ {
32+ A , B
33+ }
34+
2935 public int X { get ; set ; }
3036 public int Y { get ; set ; } = 12345 ;
3137 public float Z { get ; set ; } = 678.9f ;
3238 public string S { get ; set ; } = "aaaaaaaaa" ;
3339 public bool B { get ; set ; } = true ;
3440 public List < string > Alpha { get ; set ; } = new List < string > ( new HashSet < string > ( ) ) ;
35- public TestEnum TestEnum { get ; set ; } = TestEnum . A ;
41+ public TestEnum E { get ; set ; } = TestEnum . A ;
42+ public NestedEnum E2 { get ; set ; } = NestedEnum . A ;
3643 public ( TestEnum , List < string > ) Tuple { get ; set ; } = ( TestEnum . A , new List < string > ( new HashSet < string > ( ) ) ) ;
44+ public DateTime Struct { get ; set ; } = default ! ;
3745}
3846
3947[ MemoryPackable ]
@@ -44,14 +52,18 @@ partial class CtorParamDefaultValue
4452 public float Z ;
4553 public string S ;
4654 public bool B ;
55+ public decimal D ;
56+ public DateTime StructValue ;
4757
4858 [ MemoryPackConstructor ]
49- public CtorParamDefaultValue ( int x , int y = 12345 , float z = 678.9f , string s = "aaaaaa" , bool b = true , decimal d = 99M )
59+ public CtorParamDefaultValue ( int x , int y = 12345 , float z = 678.9f , string s = "aaaaaa" , bool b = true , decimal d = 99M , DateTime structValue = default )
5060 {
5161 X = x ;
5262 Y = y ;
5363 Z = z ;
5464 S = s ;
5565 B = b ;
66+ D = d ;
67+ StructValue = structValue ;
5668 }
5769}
0 commit comments