@@ -6,65 +6,73 @@ namespace NHibernate.Test.DialectTest
6
6
{
7
7
[ TestFixture ]
8
8
public class FirebirdDialectFixture
9
- {
10
- #region Tests
11
- [ Test ]
12
- public void GetLimitString ( )
13
- {
14
- FirebirdDialect d = MakeDialect ( ) ;
9
+ {
10
+ #region Tests
15
11
16
- SqlString str = d . GetLimitString ( new SqlString ( "SELECT * FROM fish" ) , null , new SqlString ( "10" ) ) ;
17
- Assert . AreEqual ( "SELECT first 10 * FROM fish" , str . ToString ( ) ) ;
12
+ [ Test ]
13
+ public void GetLimitString ( )
14
+ {
15
+ FirebirdDialect d = MakeDialect ( ) ;
18
16
19
- str = d . GetLimitString ( new SqlString ( "SELECT * FROM fish ORDER BY name " ) , new SqlString ( "5" ) , new SqlString ( "15 " ) ) ;
20
- Assert . AreEqual ( "SELECT first 15 skip 5 * FROM fish ORDER BY name " , str . ToString ( ) ) ;
17
+ SqlString str = d . GetLimitString ( new SqlString ( "SELECT * FROM fish" ) , null , new SqlString ( "10 " ) ) ;
18
+ Assert . AreEqual ( "SELECT first 10 * FROM fish" , str . ToString ( ) ) ;
21
19
22
- str = d . GetLimitString ( new SqlString ( "SELECT * FROM fish ORDER BY name DESC " ) , new SqlString ( "7 " ) , new SqlString ( "28 " ) ) ;
23
- Assert . AreEqual ( "SELECT first 28 skip 7 * FROM fish ORDER BY name DESC " , str . ToString ( ) ) ;
20
+ str = d . GetLimitString ( new SqlString ( "SELECT * FROM fish ORDER BY name" ) , new SqlString ( "5 " ) , new SqlString ( "15 " ) ) ;
21
+ Assert . AreEqual ( "SELECT first 15 skip 5 * FROM fish ORDER BY name" , str . ToString ( ) ) ;
24
22
25
- str = d . GetLimitString ( new SqlString ( "SELECT DISTINCT fish.family FROM fish ORDER BY name DESC" ) , null , new SqlString ( "28" ) ) ;
26
- Assert . AreEqual ( "SELECT first 28 DISTINCT fish.family FROM fish ORDER BY name DESC" , str . ToString ( ) ) ;
23
+ str = d . GetLimitString ( new SqlString ( "SELECT * FROM fish ORDER BY name DESC" ) , new SqlString ( "7" ) ,
24
+ new SqlString ( "28" ) ) ;
25
+ Assert . AreEqual ( "SELECT first 28 skip 7 * FROM fish ORDER BY name DESC" , str . ToString ( ) ) ;
27
26
28
- str = d . GetLimitString ( new SqlString ( "SELECT DISTINCT fish.family FROM fish ORDER BY name DESC" ) , new SqlString ( "7" ) , new SqlString ( "28" ) ) ;
29
- Assert . AreEqual ( "SELECT first 28 skip 7 DISTINCT fish.family FROM fish ORDER BY name DESC" , str . ToString ( ) ) ;
30
- }
27
+ str = d . GetLimitString ( new SqlString ( "SELECT DISTINCT fish.family FROM fish ORDER BY name DESC" ) , null ,
28
+ new SqlString ( "28" ) ) ;
29
+ Assert . AreEqual ( "SELECT first 28 DISTINCT fish.family FROM fish ORDER BY name DESC" , str . ToString ( ) ) ;
31
30
32
- [ Test ]
33
- public void GetTypeName_DecimalWithoutPrecisionAndScale_ReturnsDecimalWithPrecisionOf18AndScaleOf5 ( )
34
- {
35
- var fbDialect = MakeDialect ( ) ;
31
+ str = d . GetLimitString ( new SqlString ( "SELECT DISTINCT fish.family FROM fish ORDER BY name DESC" ) , new SqlString ( "7" ) ,
32
+ new SqlString ( "28" ) ) ;
33
+ Assert . AreEqual ( "SELECT first 28 skip 7 DISTINCT fish.family FROM fish ORDER BY name DESC" , str . ToString ( ) ) ;
34
+ }
36
35
37
- var result = fbDialect . GetTypeName ( NHibernateUtil . Decimal . SqlType ) ;
36
+ [ Test ]
37
+ public void GetTypeName_DecimalWithoutPrecisionAndScale_ReturnsDecimalWithPrecisionOf18AndScaleOf5 ( )
38
+ {
39
+ var fbDialect = MakeDialect ( ) ;
38
40
39
- Assert . AreEqual ( "DECIMAL(18, 5)" , result ) ;
40
- }
41
+ var result = fbDialect . GetTypeName ( NHibernateUtil . Decimal . SqlType ) ;
41
42
42
- [ Test ]
43
- public void GetTypeName_DecimalWithPrecisionAndScale_ReturnsPrecisedAndScaledDecimal ( )
44
- {
45
- var fbDialect = MakeDialect ( ) ;
43
+ Assert . AreEqual ( "DECIMAL(18, 5)" , result ) ;
44
+ }
46
45
47
- var result = fbDialect . GetTypeName ( NHibernateUtil . Decimal . SqlType , 0 , 17 , 2 ) ;
46
+ [ Test ]
47
+ public void GetTypeName_DecimalWithPrecisionAndScale_ReturnsPrecisedAndScaledDecimal ( )
48
+ {
49
+ var fbDialect = MakeDialect ( ) ;
48
50
49
- Assert . AreEqual ( "DECIMAL(17, 2)" , result ) ;
50
- }
51
+ var result = fbDialect . GetTypeName ( NHibernateUtil . Decimal . SqlType , 0 , 17 , 2 ) ;
51
52
52
- [ Test ]
53
- public void GetTypeName_DecimalWithPrecisionGreaterThanFbMaxPrecision_ReturnsDecimalWithFbMaxPrecision ( )
54
- {
55
- var fbDialect = MakeDialect ( ) ;
53
+ Assert . AreEqual ( "DECIMAL(17, 2)" , result ) ;
54
+ }
56
55
57
- var result = fbDialect . GetTypeName ( NHibernateUtil . Decimal . SqlType , 0 , 19 , 2 ) ; //Firebird allows a maximum precision of 18
56
+ [ Test ]
57
+ public void GetTypeName_DecimalWithPrecisionGreaterThanFbMaxPrecision_ReturnsDecimalWithFbMaxPrecision ( )
58
+ {
59
+ var fbDialect = MakeDialect ( ) ;
58
60
59
- Assert . AreEqual ( "DECIMAL(18, 2)" , result ) ;
60
- }
61
- #endregion
61
+ var result = fbDialect . GetTypeName ( NHibernateUtil . Decimal . SqlType , 0 , 19 , 2 ) ;
62
+ //Firebird allows a maximum precision of 18
62
63
63
- #region Private Members
64
- private static FirebirdDialect MakeDialect ( )
65
- {
66
- return new FirebirdDialect ( ) ;
67
- }
68
- #endregion
69
- }
64
+ Assert . AreEqual ( "DECIMAL(18, 2)" , result ) ;
65
+ }
66
+
67
+ #endregion
68
+
69
+ #region Private Members
70
+
71
+ private static FirebirdDialect MakeDialect ( )
72
+ {
73
+ return new FirebirdDialect ( ) ;
74
+ }
75
+
76
+ #endregion
77
+ }
70
78
}
0 commit comments