@@ -226,18 +226,19 @@ PRIMARY KEY (DecimalField)
226226
227227 await new YdbCommand ( ydbConnection ) { CommandText = $ "DROP TABLE { decimalTableName } ;" } . ExecuteNonQueryAsync ( ) ;
228228 }
229-
229+
230230 [ Fact ]
231231 public async Task Decimal_WhenFractionalDigitsExceedScale_Throws ( )
232232 {
233233 await using var ydb = await CreateOpenConnectionAsync ( ) ;
234234 var t = $ "T_{ Random . Shared . Next ( ) } ";
235- await new YdbCommand ( ydb ) { CommandText = $ "CREATE TABLE { t } (d Decimal(5,2), PRIMARY KEY(d))" } . ExecuteNonQueryAsync ( ) ;
235+ await new YdbCommand ( ydb ) { CommandText = $ "CREATE TABLE { t } (d Decimal(5,2), PRIMARY KEY(d))" }
236+ . ExecuteNonQueryAsync ( ) ;
236237
237238 var cmd = new YdbCommand ( ydb )
238239 {
239240 CommandText = $ "INSERT INTO { t } (d) VALUES (@d);",
240- Parameters = { new YdbParameter ( "d" , DbType . Decimal , 123.456m ) { Precision = 5 , Scale = 2 } }
241+ Parameters = { new YdbParameter ( "d" , DbType . Decimal , 123.456m ) { Precision = 5 , Scale = 2 } }
241242 } ;
242243
243244 await Assert . ThrowsAsync < OverflowException > ( ( ) => cmd . ExecuteNonQueryAsync ( ) ) ;
@@ -248,28 +249,30 @@ public async Task Decimal_WhenIntegerDigitsExceedPrecisionMinusScale_Throws()
248249 {
249250 await using var ydb = await CreateOpenConnectionAsync ( ) ;
250251 var t = $ "T_{ Random . Shared . Next ( ) } ";
251- await new YdbCommand ( ydb ) { CommandText = $ "CREATE TABLE { t } (d Decimal(5,0), PRIMARY KEY(d))" } . ExecuteNonQueryAsync ( ) ;
252+ await new YdbCommand ( ydb ) { CommandText = $ "CREATE TABLE { t } (d Decimal(5,0), PRIMARY KEY(d))" }
253+ . ExecuteNonQueryAsync ( ) ;
252254
253255 var cmd = new YdbCommand ( ydb )
254256 {
255257 CommandText = $ "INSERT INTO { t } (d) VALUES (@d);",
256- Parameters = { new YdbParameter ( "d" , DbType . Decimal , 100000m ) { Precision = 5 , Scale = 0 } } // 6 целых цифр
258+ Parameters = { new YdbParameter ( "d" , DbType . Decimal , 100000m ) { Precision = 5 , Scale = 0 } }
257259 } ;
258260
259261 await Assert . ThrowsAsync < OverflowException > ( ( ) => cmd . ExecuteNonQueryAsync ( ) ) ;
260262 }
261-
263+
262264 [ Fact ]
263265 public async Task Decimal_WhenScaleGreaterThanPrecision_ThrowsByMathNotByIf ( )
264266 {
265267 await using var ydb = await CreateOpenConnectionAsync ( ) ;
266268 var t = $ "T_{ Random . Shared . Next ( ) } ";
267- await new YdbCommand ( ydb ) { CommandText = $ "CREATE TABLE { t } (d Decimal(5,4), PRIMARY KEY(d))" } . ExecuteNonQueryAsync ( ) ;
269+ await new YdbCommand ( ydb ) { CommandText = $ "CREATE TABLE { t } (d Decimal(5,4), PRIMARY KEY(d))" }
270+ . ExecuteNonQueryAsync ( ) ;
268271
269272 var cmd = new YdbCommand ( ydb )
270273 {
271274 CommandText = $ "INSERT INTO { t } (d) VALUES (@d);",
272- Parameters = { new YdbParameter ( "d" , DbType . Decimal , 0.0m ) { Precision = 1 , Scale = 2 } }
275+ Parameters = { new YdbParameter ( "d" , DbType . Decimal , 0.0m ) { Precision = 1 , Scale = 2 } }
273276 } ;
274277
275278 await Assert . ThrowsAnyAsync < Exception > ( ( ) => cmd . ExecuteNonQueryAsync ( ) ) ;
@@ -280,14 +283,15 @@ public async Task Decimal_WhenYdbReturnsDecimal35_0_OverflowsDotNetDecimal()
280283 {
281284 await using var ydb = await CreateOpenConnectionAsync ( ) ;
282285 var t = $ "T_{ Random . Shared . Next ( ) } ";
283- await new YdbCommand ( ydb ) { CommandText = $ "CREATE TABLE { t } (d Decimal(35,0), PRIMARY KEY(d))" } . ExecuteNonQueryAsync ( ) ;
286+ await new YdbCommand ( ydb ) { CommandText = $ "CREATE TABLE { t } (d Decimal(35,0), PRIMARY KEY(d))" }
287+ . ExecuteNonQueryAsync ( ) ;
284288
285289 await new YdbCommand ( ydb )
286290 {
287291 CommandText = $@ "INSERT INTO { t } (d) VALUES (CAST('10000000000000000000000000000000000' AS Decimal(35,0)));"
288292 } . ExecuteNonQueryAsync ( ) ;
289293
290- var select = new YdbCommand ( ydb ) { CommandText = $ "SELECT d FROM { t } ;" } ;
294+ var select = new YdbCommand ( ydb ) { CommandText = $ "SELECT d FROM { t } ;" } ;
291295
292296 await Assert . ThrowsAsync < OverflowException > ( ( ) => select . ExecuteScalarAsync ( ) ) ;
293297 }
0 commit comments