Skip to content

Commit 056df40

Browse files
BoltunJackiedanielgerlag
authored andcommitted
[UnitTest] Add SqlServer testing
1 parent cb8451b commit 056df40

File tree

4 files changed

+82
-0
lines changed

4 files changed

+82
-0
lines changed

WorkflowCore.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Sample12", "sr
8282
EndProject
8383
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Tests.Sqlite", "test\WorkflowCore.Tests.Sqlite\WorkflowCore.Tests.Sqlite.csproj", "{F9F8F9CD-01D9-468B-856D-6A87F0762A01}"
8484
EndProject
85+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Tests.SqlServer", "test\WorkflowCore.Tests.SqlServer\WorkflowCore.Tests.SqlServer.csproj", "{A4B8E54D-F8FE-4358-AE14-A5354E828938}"
86+
EndProject
8587
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.LockProviders.SqlServer", "src\providers\WorkflowCore.LockProviders.SqlServer\WorkflowCore.LockProviders.SqlServer.csproj", "{AAE2E9F9-37EF-4AE1-A200-D37417C9040C}"
8688
EndProject
8789
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkflowCore.Sample13", "src\samples\WorkflowCore.Sample13\WorkflowCore.Sample13.csproj", "{77C49ACA-203E-428C-A4DB-114DFE454988}"
@@ -234,6 +236,10 @@ Global
234236
{F9F8F9CD-01D9-468B-856D-6A87F0762A01}.Debug|Any CPU.Build.0 = Debug|Any CPU
235237
{F9F8F9CD-01D9-468B-856D-6A87F0762A01}.Release|Any CPU.ActiveCfg = Release|Any CPU
236238
{F9F8F9CD-01D9-468B-856D-6A87F0762A01}.Release|Any CPU.Build.0 = Release|Any CPU
239+
{A4B8E54D-F8FE-4358-AE14-A5354E828938}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
240+
{A4B8E54D-F8FE-4358-AE14-A5354E828938}.Debug|Any CPU.Build.0 = Debug|Any CPU
241+
{A4B8E54D-F8FE-4358-AE14-A5354E828938}.Release|Any CPU.ActiveCfg = Release|Any CPU
242+
{A4B8E54D-F8FE-4358-AE14-A5354E828938}.Release|Any CPU.Build.0 = Release|Any CPU
237243
{AAE2E9F9-37EF-4AE1-A200-D37417C9040C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
238244
{AAE2E9F9-37EF-4AE1-A200-D37417C9040C}.Debug|Any CPU.Build.0 = Debug|Any CPU
239245
{AAE2E9F9-37EF-4AE1-A200-D37417C9040C}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -298,6 +304,7 @@ Global
298304
{58D0480F-D05D-4348-86D9-B0A7255700E6} = {5080DB09-CBE8-4C45-9957-C3BB7651755E}
299305
{BB776411-D279-419F-8697-5C6F52BCD5CD} = {5080DB09-CBE8-4C45-9957-C3BB7651755E}
300306
{F9F8F9CD-01D9-468B-856D-6A87F0762A01} = {E6CEAD8D-F565-471E-A0DC-676F54EAEDEB}
307+
{A4B8E54D-F8FE-4358-AE14-A5354E828938} = {E6CEAD8D-F565-471E-A0DC-676F54EAEDEB}
301308
{AAE2E9F9-37EF-4AE1-A200-D37417C9040C} = {2EEE6ABD-EE9B-473F-AF2D-6DABB85D7BA2}
302309
{77C49ACA-203E-428C-A4DB-114DFE454988} = {5080DB09-CBE8-4C45-9957-C3BB7651755E}
303310
{A2374B7C-4198-40B3-B8FE-FAC3DB3F2539} = {2EEE6ABD-EE9B-473F-AF2D-6DABB85D7BA2}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using Xunit;
5+
6+
namespace WorkflowCore.Tests.SqlServer
7+
{
8+
[CollectionDefinition("SqlServer collection")]
9+
public class SqlServerCollection : ICollectionFixture<SqlServerSetup>
10+
{
11+
}
12+
13+
public class SqlServerSetup : IDisposable
14+
{
15+
public string ConnectionString { get; set; }
16+
17+
public SqlServerSetup()
18+
{
19+
ConnectionString = @"Server=.\SQLEXPRESS;Database=WorkflowCore-test;Trusted_Connection=True;";
20+
}
21+
22+
public void Dispose()
23+
{
24+
25+
}
26+
}
27+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using WorkflowCore.Interface;
2+
using WorkflowCore.Persistence.SqlServer;
3+
using WorkflowCore.UnitTests;
4+
using Xunit;
5+
6+
namespace WorkflowCore.Tests.SqlServer
7+
{
8+
[Collection("SqlServer collection")]
9+
public class SqlServerPersistenceProviderFixture : BasePersistenceFixture
10+
{
11+
string _connectionString;
12+
13+
public SqlServerPersistenceProviderFixture(SqlServerSetup setup)
14+
{
15+
_connectionString = setup.ConnectionString;
16+
}
17+
18+
protected override IPersistenceProvider Subject
19+
{
20+
get
21+
{
22+
var db = new SqlServerPersistenceProvider(_connectionString, true, true);
23+
db.EnsureStoreExists();
24+
return db;
25+
}
26+
}
27+
}
28+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>netcoreapp1.1</TargetFramework>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0" />
9+
<PackageReference Include="xunit" Version="2.2.0" />
10+
<PackageReference Include="xunit.runner.visualstudio" Version="2.2.0" />
11+
</ItemGroup>
12+
13+
<ItemGroup>
14+
<ProjectReference Include="..\..\src\providers\WorkflowCore.Persistence.SqlServer\WorkflowCore.Persistence.SqlServer.csproj" />
15+
<ProjectReference Include="..\..\src\WorkflowCore\WorkflowCore.csproj" />
16+
<ProjectReference Include="..\WorkflowCore.IntegrationTests\WorkflowCore.IntegrationTests.csproj" />
17+
<ProjectReference Include="..\WorkflowCore.UnitTests\WorkflowCore.UnitTests.csproj" />
18+
</ItemGroup>
19+
20+
</Project>

0 commit comments

Comments
 (0)