You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/Conformance.Tests/GetValueConversionTests.cs
+18Lines changed: 18 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -159,6 +159,24 @@ public GetValueConversionTests(SelectValueFixture fixture)
159
159
publicoverridevoidGetDateTime_for_minimum_DateTime()=>TestGetValue(DbType.Date,ValueKind.Minimum, x =>x.GetDateTime(0),newDateTime(1000,1,1));
160
160
publicoverridevoidGetDateTime_for_minimum_DateTime_with_GetFieldValue()=>TestGetValue(DbType.Date,ValueKind.Minimum, x =>x.GetDateTime(0),newDateTime(1000,1,1));
161
161
162
+
// GetDecimal() allows conversions from float/double
163
+
publicoverridevoidGetDecimal_throws_for_zero_Single()=>TestGetValue(DbType.Single,ValueKind.Zero, x =>x.GetDecimal(0),0m);
164
+
publicoverridevoidGetDecimal_throws_for_zero_Single_with_GetFieldValue()=>TestGetValue(DbType.Single,ValueKind.Zero, x =>x.GetDecimal(0),0m);
165
+
publicoverridevoidGetDecimal_throws_for_one_Single()=>TestGetValue(DbType.Single,ValueKind.One, x =>x.GetDecimal(0),1m);
166
+
publicoverridevoidGetDecimal_throws_for_one_Single_with_GetFieldValue()=>TestGetValue(DbType.Single,ValueKind.One, x =>x.GetDecimal(0),1m);
167
+
publicoverridevoidGetDecimal_throws_for_minimum_Single()=>TestGetValue(DbType.Single,ValueKind.Minimum, x =>x.GetDecimal(0),0m);
168
+
publicoverridevoidGetDecimal_throws_for_minimum_Single_with_GetFieldValue()=>TestGetValue(DbType.Single,ValueKind.Minimum, x =>x.GetDecimal(0),0m);
169
+
publicoverridevoidGetDecimal_throws_for_maximum_Single()=>TestException(DbType.Single,ValueKind.Maximum, x =>x.GetDecimal(0),typeof(OverflowException));
170
+
publicoverridevoidGetDecimal_throws_for_maximum_Single_with_GetFieldValue()=>TestException(DbType.Single,ValueKind.Maximum, x =>x.GetDecimal(0),typeof(OverflowException));
171
+
publicoverridevoidGetDecimal_throws_for_zero_Double()=>TestGetValue(DbType.Double,ValueKind.Zero, x =>x.GetDecimal(0),0m);
172
+
publicoverridevoidGetDecimal_throws_for_zero_Double_with_GetFieldValue()=>TestGetValue(DbType.Double,ValueKind.Zero, x =>x.GetDecimal(0),0m);
173
+
publicoverridevoidGetDecimal_throws_for_one_Double()=>TestGetValue(DbType.Double,ValueKind.One, x =>x.GetDecimal(0),1m);
174
+
publicoverridevoidGetDecimal_throws_for_one_Double_with_GetFieldValue()=>TestGetValue(DbType.Double,ValueKind.One, x =>x.GetDecimal(0),1m);
175
+
publicoverridevoidGetDecimal_throws_for_minimum_Double()=>TestGetValue(DbType.Double,ValueKind.Minimum, x =>x.GetDecimal(0),0m);
176
+
publicoverridevoidGetDecimal_throws_for_minimum_Double_with_GetFieldValue()=>TestGetValue(DbType.Double,ValueKind.Minimum, x =>x.GetDecimal(0),0m);
177
+
publicoverridevoidGetDecimal_throws_for_maximum_Double()=>TestException(DbType.Double,ValueKind.Maximum, x =>x.GetDecimal(0),typeof(OverflowException));
178
+
publicoverridevoidGetDecimal_throws_for_maximum_Double_with_GetFieldValue()=>TestException(DbType.Double,ValueKind.Maximum, x =>x.GetDecimal(0),typeof(OverflowException));
179
+
162
180
// The GetFloat() implementation allows for conversions from double to float.
163
181
// The minimum tests for float and double do not test for the smallest possible value (as the tests for integer values do),
164
182
// but test for the largest value smaller than 0 (Epsilon).
0 commit comments