Skip to content

Commit

Permalink
Added tests related to issue dotnet#14457
Browse files Browse the repository at this point in the history
  • Loading branch information
mirol-h committed Aug 2, 2019
1 parent 1063e05 commit 97ada60
Showing 1 changed file with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,44 @@ public override void AddColumnOperation_with_maxLength()
");
}

[ConditionalFact]
public virtual void AddColumnOperation_datetime_with_defaultValue()
{
Generate(
new AddColumnOperation
{
Table = "People",
Schema = "dbo",
Name = "Birthday",
ClrType = typeof(DateTime),
ColumnType = "datetime",
IsNullable = false,
DefaultValue = new DateTime(2019, 1, 1)
});

AssertSql(@"ALTER TABLE [dbo].[People] ADD [Birthday] datetime NOT NULL DEFAULT '2019-01-01T00:00:00.000';
");
}

[ConditionalFact]
public virtual void AddColumnOperation_smalldatetime_with_defaultValue()
{
Generate(
new AddColumnOperation
{
Table = "People",
Schema = "dbo",
Name = "Birthday",
ClrType = typeof(DateTime),
ColumnType = "smalldatetime",
IsNullable = false,
DefaultValue = new DateTime(2019, 1, 1)
});

AssertSql(@"ALTER TABLE [dbo].[People] ADD [Birthday] smalldatetime NOT NULL DEFAULT '2019-01-01T00:00:00';
");
}

public override void AddColumnOperation_with_maxLength_overridden()
{
base.AddColumnOperation_with_maxLength_overridden();
Expand Down

0 comments on commit 97ada60

Please sign in to comment.