Skip to content

Commit 5e3fd2b

Browse files
author
Marc Sallin
committed
#23: Added test for HashCreator.
1 parent c3cb75f commit 5e3fd2b

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@
9292
<Compile Include="Statement\CreateTableStatementTest.cs" />
9393
<Compile Include="Statement\CreateIndexStatementCollectionTest.cs" />
9494
<Compile Include="Statement\ColumnStatementTest.cs" />
95+
<Compile Include="Utility\HashCreatorTest.cs" />
9596
</ItemGroup>
9697
<ItemGroup>
9798
<Folder Include="Convention\" />
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using Microsoft.VisualStudio.TestTools.UnitTesting;
2+
using SQLite.CodeFirst.Utility;
3+
4+
namespace SQLite.CodeFirst.Test.Utility
5+
{
6+
[TestClass]
7+
public class HashCreatorTest
8+
{
9+
[TestMethod]
10+
public void CreateHashTest()
11+
{
12+
string result = HashCreator.CreateHash("Test,Test,Test");
13+
Assert.AreEqual("kMbs8GbjyafvacMkuACV+tDtaoM9ii8y7pxi8AjgfcFincyIrDiD6R8kTiO5lupnmcYqZMUHtQk144aV3HTTCg==", result);
14+
}
15+
16+
[TestMethod]
17+
public void CreateHashNotSameHashTest()
18+
{
19+
string result = HashCreator.CreateHash("Test,Test,Test!");
20+
Assert.AreNotEqual("kMbs8GbjyafvacMkuACV+tDtaoM9ii8y7pxi8AjgfcFincyIrDiD6R8kTiO5lupnmcYqZMUHtQk144aV3HTTCg==", result);
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)