@@ -7,147 +7,147 @@ namespace Migrator.Tests.Providers
77 /// <summary>
88 /// Base class for Provider tests for all tests including constraint oriented tests.
99 /// </summary>
10- public class TransformationProviderConstraintBase : TransformationProviderBase
10+ public abstract class TransformationProviderConstraintBase : TransformationProviderBase
1111 {
1212 public void AddForeignKey ( )
1313 {
1414 AddTableWithPrimaryKey ( ) ;
15- _provider . AddForeignKey ( "FK_Test_TestTwo" , "TestTwo" , "TestId" , "Test" , "Id" ) ;
15+ Provider . AddForeignKey ( "FK_Test_TestTwo" , "TestTwo" , "TestId" , "Test" , "Id" ) ;
1616 }
1717
1818 public void AddPrimaryKey ( )
1919 {
2020 AddTable ( ) ;
21- _provider . AddPrimaryKey ( "PK_Test" , "Test" , "Id" ) ;
21+ Provider . AddPrimaryKey ( "PK_Test" , "Test" , "Id" ) ;
2222 }
2323
2424 public void AddUniqueConstraint ( )
2525 {
26- _provider . AddUniqueConstraint ( "UN_Test_TestTwo" , "TestTwo" , "TestId" ) ;
26+ Provider . AddUniqueConstraint ( "UN_Test_TestTwo" , "TestTwo" , "TestId" ) ;
2727 }
2828
2929 public void AddMultipleUniqueConstraint ( )
3030 {
31- _provider . AddUniqueConstraint ( "UN_Test_TestTwo" , "TestTwo" , "Id" , "TestId" ) ;
31+ Provider . AddUniqueConstraint ( "UN_Test_TestTwo" , "TestTwo" , "Id" , "TestId" ) ;
3232 }
3333
3434 public void AddCheckConstraint ( )
3535 {
36- _provider . AddCheckConstraint ( "CK_TestTwo_TestId" , "TestTwo" , "TestId>5" ) ;
36+ Provider . AddCheckConstraint ( "CK_TestTwo_TestId" , "TestTwo" , "TestId>5" ) ;
3737 }
3838
3939 [ Test ]
4040 public void CanAddPrimaryKey ( )
4141 {
4242 AddPrimaryKey ( ) ;
43- Assert . That ( _provider . PrimaryKeyExists ( "Test" , "PK_Test" ) , Is . True ) ;
43+ Assert . That ( Provider . PrimaryKeyExists ( "Test" , "PK_Test" ) , Is . True ) ;
4444 }
4545
4646 [ Test ]
4747 public void AddIndexedColumn ( )
4848 {
49- _provider . AddColumn ( "TestTwo" , "Test" , DbType . String , 50 , ColumnProperty . Indexed ) ;
49+ Provider . AddColumn ( "TestTwo" , "Test" , DbType . String , 50 , ColumnProperty . Indexed ) ;
5050 }
5151
5252 [ Test ]
5353 public void AddUniqueColumn ( )
5454 {
55- _provider . AddColumn ( "TestTwo" , "Test" , DbType . String , 50 , ColumnProperty . Unique ) ;
55+ Provider . AddColumn ( "TestTwo" , "Test" , DbType . String , 50 , ColumnProperty . Unique ) ;
5656 }
5757
5858 [ Test ]
5959 public void CanAddForeignKey ( )
6060 {
6161 AddForeignKey ( ) ;
62- Assert . That ( _provider . ConstraintExists ( "TestTwo" , "FK_Test_TestTwo" ) , Is . True ) ;
62+ Assert . That ( Provider . ConstraintExists ( "TestTwo" , "FK_Test_TestTwo" ) , Is . True ) ;
6363 }
6464
6565 [ Test ]
6666 public virtual void CanAddUniqueConstraint ( )
6767 {
6868 AddUniqueConstraint ( ) ;
69- Assert . That ( _provider . ConstraintExists ( "TestTwo" , "UN_Test_TestTwo" ) , Is . True ) ;
69+ Assert . That ( Provider . ConstraintExists ( "TestTwo" , "UN_Test_TestTwo" ) , Is . True ) ;
7070 }
7171
7272 [ Test ]
7373 public virtual void CanAddMultipleUniqueConstraint ( )
7474 {
7575 AddMultipleUniqueConstraint ( ) ;
76- Assert . That ( _provider . ConstraintExists ( "TestTwo" , "UN_Test_TestTwo" ) , Is . True ) ;
76+ Assert . That ( Provider . ConstraintExists ( "TestTwo" , "UN_Test_TestTwo" ) , Is . True ) ;
7777 }
7878
7979 [ Test ]
8080 public virtual void CanAddCheckConstraint ( )
8181 {
8282 AddCheckConstraint ( ) ;
83- Assert . That ( _provider . ConstraintExists ( "TestTwo" , "CK_TestTwo_TestId" ) , Is . True ) ;
83+ Assert . That ( Provider . ConstraintExists ( "TestTwo" , "CK_TestTwo_TestId" ) , Is . True ) ;
8484 }
8585
8686 [ Test ]
8787 public void RemoveForeignKey ( )
8888 {
8989 AddForeignKey ( ) ;
90- _provider . RemoveForeignKey ( "TestTwo" , "FK_Test_TestTwo" ) ;
91- Assert . That ( _provider . ConstraintExists ( "TestTwo" , "FK_Test_TestTwo" ) , Is . False ) ;
90+ Provider . RemoveForeignKey ( "TestTwo" , "FK_Test_TestTwo" ) ;
91+ Assert . That ( Provider . ConstraintExists ( "TestTwo" , "FK_Test_TestTwo" ) , Is . False ) ;
9292 }
9393
9494 [ Test ]
9595 public void RemoveUniqueConstraint ( )
9696 {
9797 AddUniqueConstraint ( ) ;
98- _provider . RemoveConstraint ( "TestTwo" , "UN_Test_TestTwo" ) ;
99- Assert . That ( _provider . ConstraintExists ( "TestTwo" , "UN_Test_TestTwo" ) , Is . False ) ;
98+ Provider . RemoveConstraint ( "TestTwo" , "UN_Test_TestTwo" ) ;
99+ Assert . That ( Provider . ConstraintExists ( "TestTwo" , "UN_Test_TestTwo" ) , Is . False ) ;
100100 }
101101
102102 [ Test ]
103103 public virtual void RemoveCheckConstraint ( )
104104 {
105105 AddCheckConstraint ( ) ;
106- _provider . RemoveConstraint ( "TestTwo" , "CK_TestTwo_TestId" ) ;
107- Assert . That ( _provider . ConstraintExists ( "TestTwo" , "CK_TestTwo_TestId" ) , Is . False ) ;
106+ Provider . RemoveConstraint ( "TestTwo" , "CK_TestTwo_TestId" ) ;
107+ Assert . That ( Provider . ConstraintExists ( "TestTwo" , "CK_TestTwo_TestId" ) , Is . False ) ;
108108 }
109109
110110 [ Test ]
111111 public void RemoveUnexistingForeignKey ( )
112112 {
113113 AddForeignKey ( ) ;
114- _provider . RemoveForeignKey ( "abc" , "FK_Test_TestTwo" ) ;
115- _provider . RemoveForeignKey ( "abc" , "abc" ) ;
116- _provider . RemoveForeignKey ( "Test" , "abc" ) ;
114+ Provider . RemoveForeignKey ( "abc" , "FK_Test_TestTwo" ) ;
115+ Provider . RemoveForeignKey ( "abc" , "abc" ) ;
116+ Provider . RemoveForeignKey ( "Test" , "abc" ) ;
117117 }
118118
119119 [ Test ]
120120 public void ConstraintExist ( )
121121 {
122122 AddForeignKey ( ) ;
123- Assert . That ( _provider . ConstraintExists ( "TestTwo" , "FK_Test_TestTwo" ) , Is . True ) ;
124- Assert . That ( _provider . ConstraintExists ( "abc" , "abc" ) , Is . False ) ;
123+ Assert . That ( Provider . ConstraintExists ( "TestTwo" , "FK_Test_TestTwo" ) , Is . True ) ;
124+ Assert . That ( Provider . ConstraintExists ( "abc" , "abc" ) , Is . False ) ;
125125 }
126126
127127 [ Test ]
128128 public void AddTableWithCompoundPrimaryKey ( )
129129 {
130- _provider . AddTable ( "Test" ,
130+ Provider . AddTable ( "Test" ,
131131 new Column ( "PersonId" , DbType . Int32 , ColumnProperty . PrimaryKey ) ,
132132 new Column ( "AddressId" , DbType . Int32 , ColumnProperty . PrimaryKey )
133133 ) ;
134134
135- Assert . That ( _provider . TableExists ( "Test" ) , Is . True , "Table doesn't exist" ) ;
136- Assert . That ( _provider . PrimaryKeyExists ( "Test" , "PK_Test" ) , Is . True , "Constraint doesn't exist" ) ;
135+ Assert . That ( Provider . TableExists ( "Test" ) , Is . True , "Table doesn't exist" ) ;
136+ Assert . That ( Provider . PrimaryKeyExists ( "Test" , "PK_Test" ) , Is . True , "Constraint doesn't exist" ) ;
137137 }
138138
139139 [ Test ]
140140 public void AddTableWithCompoundPrimaryKeyShouldKeepNullForOtherProperties ( )
141141 {
142- _provider . AddTable ( "Test" ,
142+ Provider . AddTable ( "Test" ,
143143 new Column ( "PersonId" , DbType . Int32 , ColumnProperty . PrimaryKey ) ,
144144 new Column ( "AddressId" , DbType . Int32 , ColumnProperty . PrimaryKey ) ,
145145 new Column ( "Name" , DbType . String , 30 , ColumnProperty . Null )
146146 ) ;
147- Assert . That ( _provider . TableExists ( "Test" ) , Is . True , "Table doesn't exist" ) ;
148- Assert . That ( _provider . PrimaryKeyExists ( "Test" , "PK_Test" ) , Is . True , "Constraint doesn't exist" ) ;
147+ Assert . That ( Provider . TableExists ( "Test" ) , Is . True , "Table doesn't exist" ) ;
148+ Assert . That ( Provider . PrimaryKeyExists ( "Test" , "PK_Test" ) , Is . True , "Constraint doesn't exist" ) ;
149149
150- Column column = _provider . GetColumnByName ( "Test" , "Name" ) ;
150+ Column column = Provider . GetColumnByName ( "Test" , "Name" ) ;
151151 Assert . That ( column , Is . Not . Null ) ;
152152 Assert . That ( ( column . ColumnProperty & ColumnProperty . Null ) == ColumnProperty . Null , Is . True ) ;
153153 }
0 commit comments