Example #1
0
 public void primary_key_no_options()
 {
     var pk = new SqlServerUniqueKeyWriter(_sb);
     
     pk.Write(_key);
     Assert.Equal(" CONSTRAINT [PK_Id] PRIMARY KEY ([id],[user name])",_sb.ToString());
 }
Example #2
0
 public void primary_key_non_clustered()
 {
     var pk = new SqlServerUniqueKeyWriter(_sb);
     _key.Options.Add(SqlServerOptions.PrimaryKeyIs.NonClustered());
     pk.Write(_key);
     Assert.Equal(" CONSTRAINT [PK_Id] PRIMARY KEY NONCLUSTERED ([id],[user name])",_sb.ToString());
 }
Example #3
0
 public UniqueKeyWriterTests()
 {
     _sb = new StringBuilder();
     _key = new UniqueKeyConstraint() {Columns = "id, user name",Name = "PK_Id",IsPrimary = true};
     _writer = new SqlServerUniqueKeyWriter(_sb);
 }