Skip to content

Commit bd2a538

Browse files
committed
Test for ColumnStatementCollection.
1 parent 9a4f46e commit bd2a538

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
</Choose>
6767
<ItemGroup>
6868
<Compile Include="Properties\AssemblyInfo.cs" />
69+
<Compile Include="Statement\ColumnStatementCollectionTest.cs" />
6970
<Compile Include="Statement\PrimaryKeyStatementTest.cs" />
7071
<Compile Include="Statement\CreateDatabaseStatementTest.cs" />
7172
<Compile Include="Statement\StatementTestBase.cs" />
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using SQLite.CodeFirst.Statement;
3+
4+
namespace SQLite.CodeFirst.Test.Statement
5+
{
6+
[TestClass]
7+
public class ColumnStatementCollectionTest : StatementTestBase
8+
{
9+
[TestMethod]
10+
public void CreateStatementOneEntryTest()
11+
{
12+
var columnStatementCollection = new ColumnStatementCollection(new[] { CreateStatementMock("dummy1").Object });
13+
14+
string output = columnStatementCollection.CreateStatement();
15+
Assert.AreEqual(columnStatementCollection.Count, 1);
16+
Assert.AreEqual(output, "dummy1");
17+
}
18+
19+
[TestMethod]
20+
public void CreateStatementTwoEntryTest()
21+
{
22+
var createIndexStatementCollection = new ColumnStatementCollection(new[]
23+
{
24+
CreateStatementMock("dummy1").Object,
25+
CreateStatementMock("dummy2").Object
26+
});
27+
28+
string output = createIndexStatementCollection.CreateStatement();
29+
Assert.AreEqual(createIndexStatementCollection.Count, 2);
30+
Assert.AreEqual(output, "dummy1, dummy2");
31+
}
32+
}
33+
}

0 commit comments

Comments
 (0)