Skip to content

Commit 1270774

Browse files
committed
Test for MaxLengthConstraint.
1 parent bd2a538 commit 1270774

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-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\ColumnConstraint\MaxLengthConstraint.cs" />
6970
<Compile Include="Statement\ColumnStatementCollectionTest.cs" />
7071
<Compile Include="Statement\PrimaryKeyStatementTest.cs" />
7172
<Compile Include="Statement\CreateDatabaseStatementTest.cs" />
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using Microsoft.VisualStudio.TestTools.UnitTesting;
3+
using SQLite.CodeFirst.Statement.ColumnConstraint;
4+
5+
namespace SQLite.CodeFirst.Test.Statement.ColumnConstraint
6+
{
7+
[TestClass]
8+
public class MaxLengthConstraintTest : StatementTestBase
9+
{
10+
[TestMethod]
11+
public void CreateStatementTest()
12+
{
13+
var maxLengthConstraint = new MaxLengthConstraint(12);
14+
string output = maxLengthConstraint.CreateStatement();
15+
Assert.AreEqual(output, "(12)");
16+
}
17+
18+
[TestMethod]
19+
[ExpectedException(typeof(InvalidOperationException))]
20+
public void CreateStatementInvalidParameterTest()
21+
{
22+
var maxLengthConstraint = new MaxLengthConstraint();
23+
maxLengthConstraint.CreateStatement();
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)