Skip to content

Commit 14ebf84

Browse files
committed
Test for CreateTableStatement.
1 parent 4f584d7 commit 14ebf84

File tree

4 files changed

+29
-1
lines changed

4 files changed

+29
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
<Compile Include="Statement\CreateDatabaseStatementTest.cs" />
7171
<Compile Include="Statement\StatementTestBase.cs" />
7272
<Compile Include="Statement\ForeignKeyStatementTest.cs" />
73+
<Compile Include="Statement\CreateTableStatementTest.cs" />
7374
</ItemGroup>
7475
<ItemGroup>
7576
<Folder Include="Builder\" />
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using Moq;
3+
using SQLite.CodeFirst.Statement;
4+
5+
namespace SQLite.CodeFirst.Test.Statement
6+
{
7+
[TestClass]
8+
public class CreateTableStatementTest : StatementTestBase
9+
{
10+
[TestMethod]
11+
public void CreateStatementTest()
12+
{
13+
var statementCollectionMock = new Mock<IStatementCollection>();
14+
statementCollectionMock.Setup(s => s.CreateStatement()).Returns("dummyColumnDefinition");
15+
16+
var createTableStatement = new CreateTableStatement
17+
{
18+
TableName = "dummyTable",
19+
ColumnStatementCollection = statementCollectionMock.Object
20+
};
21+
22+
string output = createTableStatement.CreateStatement();
23+
Assert.AreEqual(output, "CREATE TABLE dummyTable (dummyColumnDefinition);");
24+
}
25+
}
26+
}

SQLite.CodeFirst/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
[assembly: AssemblyCompany("Marc Sallin")]
1313

1414
[assembly: InternalsVisibleTo("SQLite.CodeFirst.Test", AllInternalsVisible = true)]
15+
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")]
1516

1617
// Setting ComVisible to false makes the types in this assembly not visible
1718
// to COM components. If you need to access a type in this assembly from

SQLite.CodeFirst/Statement/IStatementCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace SQLite.CodeFirst.Statement
44
{
5-
interface IStatementCollection : IStatement, ICollection<IStatement>
5+
internal interface IStatementCollection : IStatement, ICollection<IStatement>
66
{
77
}
88
}

0 commit comments

Comments
 (0)