public void AddOneColumnWithAllowNullToTable_GetCorrectUpScript() { // Arrange // Act var tableAlteration = new TableAlteration<MyData>("MyTable"); tableAlteration.AddColumn(m => m.MyNewColumn, 100).Null(); var script = tableAlteration.GetUpScript().Single(); // Assert Assert.Equal("ALTER TABLE MyTable ADD\r\nMyNewColumn nvarchar(100)\r\n", script); }
public void AddTwoColumnsToTable_GetCorrectUpScript() { // Arrange // Act var tableAlteration = new TableAlteration<MyData>("MyTable"); tableAlteration.AddColumn(m => m.MyNewColumn, 100); tableAlteration.AddColumn(m => m.MyOtherNewColumn); var script = tableAlteration.GetUpScript().Single(); // Assert Assert.Equal("ALTER TABLE MyTable ADD\r\nMyNewColumn nvarchar(100) NOT NULL,\r\nMyOtherNewColumn int NOT NULL\r\n", script); }