forked from akkadotnet/akka.net
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request akkadotnet#1659 from Silv3rcircl3/NUnit3_support
Support for NUnit 3
- Loading branch information
Showing
16 changed files
with
604 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="NUnit" version="2.6.4" targetFramework="net45" /> | ||
<package id="NUnit" version="2.6.4" targetFramework="net45" allowedVersions="(,3.0.0)"/> | ||
</packages> |
77 changes: 77 additions & 0 deletions
77
src/contrib/testkits/Akka.TestKit.NUnit3.Tests/Akka.TestKit.NUnit3.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{FF91B397-1E60-4B94-99A1-B534C7BB91A5}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Akka.TestKit.NUnit3.Tests</RootNamespace> | ||
<AssemblyName>Akka.TestKit.NUnit3.Tests</AssemblyName> | ||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="nunit.framework, Version=3.0.5797.27534, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\NUnit.3.0.0\lib\net45\nunit.framework.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="AssertionsTests.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="TestKitTestFixtureTest.cs" /> | ||
<Compile Include="TestKitTests.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\core\Akka.TestKit\Akka.TestKit.csproj"> | ||
<Project>{0d3cbad0-bbdb-43e5-afc4-ed1d3ecdc224}</Project> | ||
<Name>Akka.TestKit</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\..\..\core\Akka\Akka.csproj"> | ||
<Project>{5deddf90-37f0-48d3-a0b0-a5cbd8a7e377}</Project> | ||
<Name>Akka</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\Akka.TestKit.NUnit3\Akka.TestKit.NUnit3.csproj"> | ||
<Project>{62a7bba3-2aa6-4f9b-8aca-15c3863c026e}</Project> | ||
<Name>Akka.TestKit.NUnit3</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
78 changes: 78 additions & 0 deletions
78
src/contrib/testkits/Akka.TestKit.NUnit3.Tests/AssertionsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
//----------------------------------------------------------------------- | ||
// <copyright file="AssertionsTests.cs" company="Akka.NET Project"> | ||
// Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com> | ||
// Copyright (C) 2013-2016 Akka.NET project <https://github.com/akkadotnet/akka.net> | ||
// </copyright> | ||
//---------------------------------------------------------------------- | ||
|
||
using NUnit.Framework; | ||
|
||
namespace Akka.TestKit.NUnit3.Tests | ||
{ | ||
[TestFixture] | ||
public class AssertionsTests | ||
{ | ||
private readonly NUnitAssertions _assertions; | ||
|
||
public AssertionsTests() | ||
{ | ||
_assertions = new NUnitAssertions(); | ||
} | ||
|
||
[Test] | ||
public void Fail_should_throw() | ||
{ | ||
Assert.Throws<AssertionException>(() => _assertions.Fail()); | ||
} | ||
|
||
[Test] | ||
public void AssertTrue_should_throw_on_false() | ||
{ | ||
Assert.Throws<AssertionException>(() => _assertions.AssertTrue(false)); | ||
} | ||
|
||
[Test] | ||
public void AssertTrue_should_succeed_on_true() | ||
{ | ||
_assertions.AssertTrue(true); | ||
} | ||
|
||
[Test] | ||
public void AssertFalse_should_throw_on_true() | ||
{ | ||
Assert.Throws<AssertionException>(() => _assertions.AssertFalse(true)); | ||
} | ||
|
||
[Test] | ||
public void AssertFalse_should_succeed_on_false() | ||
{ | ||
_assertions.AssertFalse(false); | ||
} | ||
|
||
|
||
[Test] | ||
public void AssertEqual_should_throw_on_not_equal() | ||
{ | ||
Assert.Throws<AssertionException>(() => _assertions.AssertEqual(42, 4711)); | ||
} | ||
|
||
[Test] | ||
public void AssertEqual_should_succeed_on_equal() | ||
{ | ||
_assertions.AssertEqual(42, 42); | ||
} | ||
|
||
|
||
[Test] | ||
public void AssertEqualWithComparer_should_throw_on_not_equal() | ||
{ | ||
Assert.Throws<AssertionException>(() => _assertions.AssertEqual(42, 42, (x, y) => false)); | ||
} | ||
|
||
[Test] | ||
public void AssertEqualWithComparer_should_succeed_on_equal() | ||
{ | ||
_assertions.AssertEqual(42, 4711, (x, y) => true); | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
src/contrib/testkits/Akka.TestKit.NUnit3.Tests/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// Allgemeine Informationen über eine Assembly werden über die folgenden | ||
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, | ||
// die einer Assembly zugeordnet sind. | ||
[assembly: AssemblyTitle("Akka.TestKit.NUnit3.Tests")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("Akka.TestKit.NUnit3.Tests")] | ||
[assembly: AssemblyCopyright("Copyright © 2016")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar | ||
// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von | ||
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. | ||
[assembly: ComVisible(false)] | ||
|
||
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird | ||
[assembly: Guid("ff91b397-1e60-4b94-99a1-b534c7bb91a5")] | ||
|
||
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: | ||
// | ||
// Hauptversion | ||
// Nebenversion | ||
// Buildnummer | ||
// Revision | ||
// | ||
// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern | ||
// übernehmen, indem Sie "*" eingeben: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
29 changes: 29 additions & 0 deletions
29
src/contrib/testkits/Akka.TestKit.NUnit3.Tests/TestKitTestFixtureTest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//----------------------------------------------------------------------- | ||
// <copyright file="TestKitTestFixtureTest.cs" company="Akka.NET Project"> | ||
// Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com> | ||
// Copyright (C) 2013-2016 Akka.NET project <https://github.com/akkadotnet/akka.net> | ||
// </copyright> | ||
//---------------------------------------------------------------------- | ||
|
||
using Akka.Actor; | ||
using Akka.TestKit.TestActors; | ||
using NUnit.Framework; | ||
|
||
namespace Akka.TestKit.NUnit3.Tests | ||
{ | ||
[TestFixture] | ||
public class TestKitTestFixtureTest : TestKit | ||
{ | ||
[Test] | ||
public void Can_create_more_than_one_test_in_a_fixture_with_the_same_actor_name_test1() | ||
{ | ||
Sys.ActorOf<BlackHoleActor>("actor-name"); | ||
} | ||
|
||
[Test] | ||
public void Can_create_more_than_one_test_in_a_fixture_with_the_same_actor_name_test2() | ||
{ | ||
Sys.ActorOf<BlackHoleActor>("actor-name"); | ||
} | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/contrib/testkits/Akka.TestKit.NUnit3.Tests/TestKitTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//----------------------------------------------------------------------- | ||
// <copyright file="TestKitTests.cs" company="Akka.NET Project"> | ||
// Copyright (C) 2009-2016 Typesafe Inc. <http://www.typesafe.com> | ||
// Copyright (C) 2013-2016 Akka.NET project <https://github.com/akkadotnet/akka.net> | ||
// </copyright> | ||
//---------------------------------------------------------------------- | ||
|
||
using Akka.Actor; | ||
using NUnit.Framework; | ||
|
||
namespace Akka.TestKit.NUnit3.Tests | ||
{ | ||
[TestFixture] | ||
public class TestKitTests : TestKit | ||
{ | ||
[TearDown] | ||
public void Cleanup() | ||
{ | ||
Shutdown(); | ||
} | ||
|
||
[Test] | ||
public void Expect_a_message() | ||
{ | ||
TestActor.Tell("Test"); | ||
ExpectMsg("Test"); | ||
} | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/contrib/testkits/Akka.TestKit.NUnit3.Tests/packages.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="NUnit" version="3.0.0" targetFramework="net452" /> | ||
</packages> |
Oops, something went wrong.