Skip to content

Commit 115c78b

Browse files
committed
Rework core test project for .NET 4.7
1 parent 700b6fc commit 115c78b

File tree

9 files changed

+115
-37
lines changed

9 files changed

+115
-37
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProjectGuid>{030204D0-6469-4A46-827E-122B0215F47E}</ProjectGuid>
7+
<OutputType>Library</OutputType>
8+
<RootNamespace>InEngine.Core.Test</RootNamespace>
9+
<AssemblyName>InEngine.Core.Test</AssemblyName>
10+
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
11+
</PropertyGroup>
12+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
13+
<DebugSymbols>true</DebugSymbols>
14+
<DebugType>full</DebugType>
15+
<Optimize>false</Optimize>
16+
<OutputPath>bin\Debug</OutputPath>
17+
<DefineConstants>DEBUG;</DefineConstants>
18+
<ErrorReport>prompt</ErrorReport>
19+
<WarningLevel>4</WarningLevel>
20+
</PropertyGroup>
21+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
22+
<Optimize>true</Optimize>
23+
<OutputPath>bin\Release</OutputPath>
24+
<ErrorReport>prompt</ErrorReport>
25+
<WarningLevel>4</WarningLevel>
26+
</PropertyGroup>
27+
<ItemGroup>
28+
<Reference Include="System" />
29+
<Reference Include="nunit.framework">
30+
<HintPath>..\packages\NUnit.3.9.0\lib\net45\nunit.framework.dll</HintPath>
31+
</Reference>
32+
<Reference Include="Quartz">
33+
<HintPath>..\packages\Quartz.2.6.1\lib\net40\Quartz.dll</HintPath>
34+
</Reference>
35+
<Reference Include="NLog">
36+
<HintPath>..\packages\NLog.4.4.12\lib\net45\NLog.dll</HintPath>
37+
</Reference>
38+
<Reference Include="Microsoft.CSharp" />
39+
<Reference Include="Common.Logging.Core">
40+
<HintPath>..\packages\Common.Logging.Core.3.4.1\lib\net40\Common.Logging.Core.dll</HintPath>
41+
</Reference>
42+
<Reference Include="Common.Logging">
43+
<HintPath>..\packages\Common.Logging.3.4.1\lib\net40\Common.Logging.dll</HintPath>
44+
</Reference>
45+
<Reference Include="Castle.Core">
46+
<HintPath>..\packages\Castle.Core.4.2.1\lib\net45\Castle.Core.dll</HintPath>
47+
</Reference>
48+
<Reference Include="System.Configuration" />
49+
<Reference Include="Moq">
50+
<HintPath>..\packages\Moq.4.7.145\lib\net45\Moq.dll</HintPath>
51+
</Reference>
52+
<Reference Include="BeekmanLabs.UnitTesting">
53+
<HintPath>..\packages\BeekmanLabs.UnitTesting.0.0.0\lib\net45\BeekmanLabs.UnitTesting.dll</HintPath>
54+
</Reference>
55+
</ItemGroup>
56+
<ItemGroup>
57+
<None Include="packages.config" />
58+
<None Include="appsettings.json">
59+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
60+
</None>
61+
<None Include="job_scheduling_data_2_0.xsd" />
62+
</ItemGroup>
63+
<ItemGroup>
64+
<Folder Include="Queue\" />
65+
<Folder Include="Queue\Commands\" />
66+
</ItemGroup>
67+
<ItemGroup>
68+
<Compile Include="Queue\Commands\ConsumeTest.cs" />
69+
<Compile Include="Queue\Commands\PublishTest.cs" Condition=" '$(EnableDefaultCompileItems)' == 'true' " />
70+
<Compile Include="Queue\Commands\PublishTest.cs" />
71+
</ItemGroup>
72+
<ItemGroup>
73+
<ProjectReference Include="..\InEngine.Core\InEngine.Core.csproj">
74+
<Project>{1C604C4F-3F98-483C-89E3-C951BE03366A}</Project>
75+
<Name>InEngine.Core</Name>
76+
</ProjectReference>
77+
<ProjectReference Include="..\InEngine.Commands\InEngine.Commands.csproj">
78+
<Project>{5EDAF024-3BD1-4D22-A6E5-9EF808DB14C8}</Project>
79+
<Name>InEngine.Commands</Name>
80+
</ProjectReference>
81+
</ItemGroup>
82+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
83+
</Project>

src/InEngine.Core.Tests/Queue/Commands/ConsumeTest.cs renamed to src/InEngine.Core.Test/Queue/Commands/ConsumeTest.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using NUnit.Framework;
99
using Quartz;
1010

11-
namespace InEngine.Core.Tests.Queue.Commands
11+
namespace InEngine.Core.Test.Queue.Commands
1212
{
1313
[TestFixture]
1414
public class ConsumeTest : TestBase<Consume>
@@ -22,7 +22,8 @@ public void Setup()
2222
[Test]
2323
public void ShouldConsumePrimaryQueue()
2424
{
25-
new Publish() {
25+
new Publish()
26+
{
2627
Command = new AlwaysSucceed()
2728
}.Run();
2829

@@ -32,8 +33,8 @@ public void ShouldConsumePrimaryQueue()
3233
[Test]
3334
public void ShouldConsumeSecondaryQueue()
3435
{
35-
var expectedMessage = "Consumed";
36-
new Publish() {
36+
new Publish()
37+
{
3738
Command = new AlwaysSucceed()
3839
}.Run();
3940
Subject.UseSecondaryQueue = true;
@@ -44,7 +45,8 @@ public void ShouldConsumeSecondaryQueue()
4445
[Test]
4546
public void ShouldConsumeSecondaryQueueBasedOnJobContextData()
4647
{
47-
new Publish() {
48+
new Publish()
49+
{
4850
Command = new AlwaysSucceed()
4951
}.Run();
5052
var jobExecutionConext = new Mock<IJobExecutionContext>();

src/InEngine.Core.Tests/Queue/Commands/PublishTest.cs renamed to src/InEngine.Core.Test/Queue/Commands/PublishTest.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using InEngine.Core.Queue.Commands;
88
using NUnit.Framework;
99

10-
namespace InEngine.Core.Tests.Queue.Commands
10+
namespace InEngine.Core.Test.Queue.Commands
1111
{
1212
[TestFixture]
1313
public class PublishTest : TestBase<Publish>
@@ -40,11 +40,13 @@ public void ShouldPublishCommandByArgs()
4040
public void ShouldPublishManyCommands()
4141
{
4242

43-
foreach (var i in Enumerable.Range(0, 200).ToList()) {
44-
Subject.Command = new Echo() {
43+
foreach (var i in Enumerable.Range(0, 200).ToList())
44+
{
45+
Subject.Command = new Echo()
46+
{
4547
VerbatimText = $"test job: {i}"
4648
};
47-
Subject.Run();
49+
Subject.Run();
4850
}
4951
}
5052

File renamed without changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="BeekmanLabs.UnitTesting" version="0.0.0" targetFramework="net461" />
4+
<package id="Castle.Core" version="4.2.1" targetFramework="net461" />
5+
<package id="Common.Logging" version="3.4.1" targetFramework="net461" />
6+
<package id="Common.Logging.Core" version="3.4.1" targetFramework="net461" />
7+
<package id="Microsoft.CSharp" version="4.0.1" targetFramework="net461" />
8+
<package id="Moq" version="4.7.145" targetFramework="net461" />
9+
<package id="NLog" version="4.4.12" targetFramework="net461" />
10+
<package id="NUnit" version="3.9.0" targetFramework="net461" />
11+
<package id="Quartz" version="2.6.1" targetFramework="net461" />
12+
</packages>

src/InEngine.Core.Tests/InEngine.Core.Tests.csproj

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/InEngine.Core/Queue/Commands/Publish.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ namespace InEngine.Core.Queue.Commands
77
{
88
public class Publish : AbstractCommand
99
{
10-
[Option("command-assembly", DefaultValue = "InEngine.Core.dll")]
10+
[Option("command-assembly", Required = true, HelpText = "The name of a command plugin, e.g. InEngine.Core.dll")]
1111
public string CommandAssembly { get; set; }
1212

13-
[Option("command-class", DefaultValue = "InEngine.Core.Queue.Commands.Null")]
13+
[Option("command-class", Required = true, DefaultValue = "The name of a command class, e.g. InEngine.Core.Commands.AlwaysSucceed")]
1414
public string CommandClass { get; set; }
1515

1616
[OptionArray("args", HelpText = "The list of arguments for the published command.")]

src/InEngine.Net.sln

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InEngine", "InEngine\InEngi
1515
EndProject
1616
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InEngine.Commands", "InEngine.Commands\InEngine.Commands.csproj", "{5EDAF024-3BD1-4D22-A6E5-9EF808DB14C8}"
1717
EndProject
18-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InEngine.Core.Tests", "InEngine.Core.Tests\InEngine.Core.Tests.csproj", "{3D3DCE12-4219-426E-AFAC-56871B21452A}"
18+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InEngine.Core.Test", "InEngine.Core.Test\InEngine.Core.Test.csproj", "{030204D0-6469-4A46-827E-122B0215F47E}"
1919
EndProject
2020
Global
2121
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -35,10 +35,10 @@ Global
3535
{5EDAF024-3BD1-4D22-A6E5-9EF808DB14C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
3636
{5EDAF024-3BD1-4D22-A6E5-9EF808DB14C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
3737
{5EDAF024-3BD1-4D22-A6E5-9EF808DB14C8}.Release|Any CPU.Build.0 = Release|Any CPU
38-
{3D3DCE12-4219-426E-AFAC-56871B21452A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39-
{3D3DCE12-4219-426E-AFAC-56871B21452A}.Debug|Any CPU.Build.0 = Debug|Any CPU
40-
{3D3DCE12-4219-426E-AFAC-56871B21452A}.Release|Any CPU.ActiveCfg = Release|Any CPU
41-
{3D3DCE12-4219-426E-AFAC-56871B21452A}.Release|Any CPU.Build.0 = Release|Any CPU
38+
{030204D0-6469-4A46-827E-122B0215F47E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
39+
{030204D0-6469-4A46-827E-122B0215F47E}.Debug|Any CPU.Build.0 = Debug|Any CPU
40+
{030204D0-6469-4A46-827E-122B0215F47E}.Release|Any CPU.ActiveCfg = Release|Any CPU
41+
{030204D0-6469-4A46-827E-122B0215F47E}.Release|Any CPU.Build.0 = Release|Any CPU
4242
EndGlobalSection
4343
GlobalSection(SolutionProperties) = preSolution
4444
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)