5
5
using System . Linq ;
6
6
using System . Reflection ;
7
7
using System . Runtime . CompilerServices ;
8
- using System . Text ;
9
8
using Sdk ;
10
9
using Validation ;
11
10
@@ -51,6 +50,17 @@ public void GetData_Int()
51
50
} ) ;
52
51
}
53
52
53
+ [ Fact ]
54
+ public void GetData_NullableInt ( )
55
+ {
56
+ AssertData ( new object [ ] [ ]
57
+ {
58
+ new object [ ] { null } ,
59
+ new object [ ] { 0 } ,
60
+ new object [ ] { 1 } ,
61
+ } ) ;
62
+ }
63
+
54
64
[ Fact ]
55
65
public void GetData_Int_35 ( )
56
66
{
@@ -92,13 +102,32 @@ public void GetData_DateTimeKind()
92
102
} ) ;
93
103
}
94
104
105
+ [ Fact ]
106
+ public void GetData_NullableDateTimeKind ( )
107
+ {
108
+ AssertData ( new object [ ] [ ]
109
+ {
110
+ new object [ ] { null } ,
111
+ new object [ ] { DateTimeKind . Unspecified } ,
112
+ new object [ ] { DateTimeKind . Utc } ,
113
+ new object [ ] { DateTimeKind . Local } ,
114
+ } ) ;
115
+ }
116
+
95
117
[ Fact ]
96
118
public void GetData_UnsupportedType ( )
97
119
{
98
120
Assert . Throws < NotSupportedException > ( ( ) => GetData ( new CombinatorialDataAttribute ( ) ) ) ;
99
121
Assert . Throws < NotSupportedException > ( ( ) => GetData ( new PairwiseDataAttribute ( ) ) ) ;
100
122
}
101
123
124
+ [ Fact ]
125
+ public void GetData_UnsupportedNullableType ( )
126
+ {
127
+ Assert . Throws < NotSupportedException > ( ( ) => GetData ( new CombinatorialDataAttribute ( ) ) ) ;
128
+ Assert . Throws < NotSupportedException > ( ( ) => GetData ( new PairwiseDataAttribute ( ) ) ) ;
129
+ }
130
+
102
131
[ Fact ]
103
132
public void GetData_CustomDataFromDerivedAttriute ( )
104
133
{
@@ -120,10 +149,13 @@ private static void Suppose_NoArguments() { }
120
149
private static void Suppose_Bool ( bool p1 ) { }
121
150
private static void Suppose_BoolBool ( bool p1 , bool p2 ) { }
122
151
private static void Suppose_Int ( int p1 ) { }
152
+ private static void Suppose_NullableInt ( int ? p1 ) { }
123
153
private static void Suppose_Int_35 ( [ CombinatorialValues ( 3 , 5 ) ] int p1 ) { }
124
154
private static void Suppose_string_int_bool_Values ( [ CombinatorialValues ( "a" , "b" ) ] string p1 , [ CombinatorialValues ( 2 , 4 , 6 ) ] int p2 , bool p3 ) { }
125
155
private static void Suppose_DateTimeKind ( DateTimeKind p1 ) { }
156
+ private static void Suppose_NullableDateTimeKind ( DateTimeKind ? p1 ) { }
126
157
private static void Suppose_UnsupportedType ( System . AggregateException p1 ) { }
158
+ private static void Suppose_UnsupportedNullableType ( Guid ? p1 ) { }
127
159
128
160
private static void AssertData ( IEnumerable < object [ ] > expectedCombinatorial , [ CallerMemberName ] string testMethodName = null )
129
161
{
0 commit comments