Skip to content

Commit 8c3fc3d

Browse files
committed
Test for ColumnStatement.
1 parent 4aa046d commit 8c3fc3d

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

SQLite.CodeFirst.Test/SQLite.CodeFirst.Test.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
<Compile Include="Statement\ForeignKeyStatementTest.cs" />
7777
<Compile Include="Statement\CreateTableStatementTest.cs" />
7878
<Compile Include="Statement\CreateIndexStatementCollectionTest.cs" />
79+
<Compile Include="Statement\ColumnStatementTest.cs" />
7980
</ItemGroup>
8081
<ItemGroup>
8182
<Folder Include="Builder\" />
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using Moq;
3+
using SQLite.CodeFirst.Statement;
4+
using SQLite.CodeFirst.Statement.ColumnConstraint;
5+
6+
namespace SQLite.CodeFirst.Test.Statement
7+
{
8+
[TestClass]
9+
public class ColumnStatementTest : StatementTestBase
10+
{
11+
[TestMethod]
12+
public void CreateStatement()
13+
{
14+
var columnConstraintsMock = new Mock<IColumnConstraintCollection>();
15+
columnConstraintsMock.Setup(c => c.CreateStatement()).Returns("dummyColumnConstraint");
16+
17+
var columnStatement = new ColumnStatement
18+
{
19+
ColumnConstraints = columnConstraintsMock.Object,
20+
ColumnName = "dummyColumnName",
21+
TypeName = "dummyType"
22+
};
23+
string output = columnStatement.CreateStatement();
24+
Assert.AreEqual(output, "[dummyColumnName] dummyType dummyColumnConstraint");
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)