@@ -19,24 +19,27 @@ public void Setup()
19
19
{
20
20
using ( var db = OpenDbConnection ( ) )
21
21
{
22
- db . DropAndCreateTable < TestType > ( ) ;
23
- db . Insert ( new TestType { Id = 1 , BoolCol = true , DateCol = new DateTime ( 2012 , 1 , 1 ) , TextCol = "asdf" , EnumCol = TestEnum . Val0 , NullableIntCol = 10 , TestType2ObjColId = 1 } ) ;
24
- db . Insert ( new TestType { Id = 2 , BoolCol = true , DateCol = new DateTime ( 2012 , 2 , 1 ) , TextCol = "asdf123" , EnumCol = TestEnum . Val1 , NullableIntCol = null , TestType2ObjColId = 2 } ) ;
25
- db . Insert ( new TestType { Id = 3 , BoolCol = false , DateCol = new DateTime ( 2012 , 3 , 1 ) , TextCol = "qwer" , EnumCol = TestEnum . Val2 , NullableIntCol = 30 , TestType2ObjColId = 3 } ) ;
26
- db . Insert ( new TestType { Id = 4 , BoolCol = false , DateCol = new DateTime ( 2012 , 4 , 1 ) , TextCol = "qwer123" , EnumCol = TestEnum . Val3 , NullableIntCol = 40 , TestType2ObjColId = 4 } ) ;
22
+ db . DropTable < TestType > ( ) ;
23
+ db . DropTable < TestType2 > ( ) ;
24
+ db . DropTable < TestType3 > ( ) ;
25
+
26
+ db . CreateTable < TestType3 > ( ) ;
27
+ db . Insert ( new TestType3 { Id = 1 , BoolCol = true , DateCol = new DateTime ( 2012 , 4 , 1 ) , TextCol = "111" , EnumCol = TestEnum . Val3 , NullableIntCol = 10 , TestType3Name = "3.1" , CustomInt = 100 } ) ;
28
+ db . Insert ( new TestType3 { Id = 2 , BoolCol = false , DateCol = new DateTime ( 2012 , 4 , 1 ) , TextCol = "222" , EnumCol = TestEnum . Val3 , NullableIntCol = 20 , TestType3Name = "3.2" , CustomInt = 200 } ) ;
29
+ db . Insert ( new TestType3 { Id = 3 , BoolCol = false , DateCol = new DateTime ( 2012 , 4 , 1 ) , TextCol = "222" , EnumCol = TestEnum . Val3 , NullableIntCol = 30 , TestType3Name = "3.3" , CustomInt = 300 } ) ;
30
+ db . Insert ( new TestType3 { Id = 4 , BoolCol = false , DateCol = new DateTime ( 2012 , 4 , 1 ) , TextCol = "222" , EnumCol = TestEnum . Val3 , NullableIntCol = 40 , TestType3Name = "3.4" , CustomInt = 400 } ) ;
27
31
28
- db . DropAndCreateTable < TestType2 > ( ) ;
29
- db . Insert ( new TestType2 { Id = 1 , BoolCol = true , DateCol = new DateTime ( 2012 , 4 , 1 ) , TextCol = "111" , EnumCol = TestEnum . Val3 , NullableIntCol = 10 , TestType2Name = "2.1" , TestType3ObjColId = 1 } ) ;
32
+ db . CreateTable < TestType2 > ( ) ;
33
+ db . Insert ( new TestType2 { Id = 1 , BoolCol = true , DateCol = new DateTime ( 2012 , 4 , 1 ) , TextCol = "111" , EnumCol = TestEnum . Val3 , NullableIntCol = 10 , TestType2Name = "2.1" , TestType3ObjColId = 1 } ) ;
30
34
db . Insert ( new TestType2 { Id = 2 , BoolCol = false , DateCol = new DateTime ( 2012 , 4 , 1 ) , TextCol = "222" , EnumCol = TestEnum . Val3 , NullableIntCol = 20 , TestType2Name = "2.2" , TestType3ObjColId = 2 } ) ;
31
35
db . Insert ( new TestType2 { Id = 3 , BoolCol = true , DateCol = new DateTime ( 2012 , 4 , 1 ) , TextCol = "333" , EnumCol = TestEnum . Val3 , NullableIntCol = 30 , TestType2Name = "2.3" , TestType3ObjColId = 3 } ) ;
32
36
db . Insert ( new TestType2 { Id = 4 , BoolCol = false , DateCol = new DateTime ( 2012 , 4 , 1 ) , TextCol = "444" , EnumCol = TestEnum . Val3 , NullableIntCol = 40 , TestType2Name = "2.4" , TestType3ObjColId = 4 } ) ;
33
37
34
-
35
- db . DropAndCreateTable < TestType3 > ( ) ;
36
- db . Insert ( new TestType3 { Id = 1 , BoolCol = true , DateCol = new DateTime ( 2012 , 4 , 1 ) , TextCol = "111" , EnumCol = TestEnum . Val3 , NullableIntCol = 10 , TestType3Name = "3.1" , CustomInt = 100 } ) ;
37
- db . Insert ( new TestType3 { Id = 2 , BoolCol = false , DateCol = new DateTime ( 2012 , 4 , 1 ) , TextCol = "222" , EnumCol = TestEnum . Val3 , NullableIntCol = 20 , TestType3Name = "3.2" , CustomInt = 200 } ) ;
38
- db . Insert ( new TestType3 { Id = 3 , BoolCol = false , DateCol = new DateTime ( 2012 , 4 , 1 ) , TextCol = "222" , EnumCol = TestEnum . Val3 , NullableIntCol = 30 , TestType3Name = "3.3" , CustomInt = 300 } ) ;
39
- db . Insert ( new TestType3 { Id = 4 , BoolCol = false , DateCol = new DateTime ( 2012 , 4 , 1 ) , TextCol = "222" , EnumCol = TestEnum . Val3 , NullableIntCol = 40 , TestType3Name = "3.4" , CustomInt = 400 } ) ;
38
+ db . CreateTable < TestType > ( ) ;
39
+ db . Insert ( new TestType { Id = 1 , BoolCol = true , DateCol = new DateTime ( 2012 , 1 , 1 ) , TextCol = "asdf" , EnumCol = TestEnum . Val0 , NullableIntCol = 10 , TestType2ObjColId = 1 } ) ;
40
+ db . Insert ( new TestType { Id = 2 , BoolCol = true , DateCol = new DateTime ( 2012 , 2 , 1 ) , TextCol = "asdf123" , EnumCol = TestEnum . Val1 , NullableIntCol = null , TestType2ObjColId = 2 } ) ;
41
+ db . Insert ( new TestType { Id = 3 , BoolCol = false , DateCol = new DateTime ( 2012 , 3 , 1 ) , TextCol = "qwer" , EnumCol = TestEnum . Val2 , NullableIntCol = 30 , TestType2ObjColId = 3 } ) ;
42
+ db . Insert ( new TestType { Id = 4 , BoolCol = false , DateCol = new DateTime ( 2012 , 4 , 1 ) , TextCol = "qwer123" , EnumCol = TestEnum . Val3 , NullableIntCol = 40 , TestType2ObjColId = 4 } ) ;
40
43
}
41
44
Db = OpenDbConnection ( ) ;
42
45
}
@@ -118,7 +121,8 @@ public void Can_Select_using_new_ComplexType()
118
121
DateCol = new DateTime ( 2012 , 5 , 1 ) ,
119
122
TextCol = "uiop" ,
120
123
EnumCol = TestEnum . Val3 ,
121
- ComplexObjCol = new TestType { TextCol = "poiu" }
124
+ ComplexObjCol = new TestType { TextCol = "poiu" } ,
125
+ TestType2ObjColId = 1
122
126
} ) ;
123
127
124
128
var target = Db . Select < TestType > (
0 commit comments