-
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.
Targets #420 Assembly loading when on TestRunner
- Loading branch information
Showing
7 changed files
with
120 additions
and
30 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
40 changes: 40 additions & 0 deletions
40
.ci/unit-tests/NUnit_TestRunner_Tests/NUnit_TestRunner_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,40 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
|
||
<IsPackable>false</IsPackable> | ||
|
||
<Configurations>Debug;Release;Test</Configurations> | ||
|
||
<OutputType>Library</OutputType> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" /> | ||
<PackageReference Include="NUnit" Version="3.13.3" /> | ||
<PackageReference Include="NUnit.Engine" Version="3.16.3" /> | ||
<PackageReference Include="NUnit3TestAdapter" Version="4.2.1" /> | ||
<PackageReference Include="NUnit.Analyzers" Version="3.3.0" /> | ||
<PackageReference Include="coverlet.collector" Version="3.1.2" /> | ||
<PackageReference Include="Shouldly" Version="4.1.0" /> | ||
<PackageReference Include="System.Data.Odbc" Version="7.0.0" /> | ||
<PackageReference Include="System.Data.OleDb" Version="7.0.0" /> | ||
<PackageReference Include="System.Data.SqlClient" Version="4.8.5" /> | ||
<PackageReference Include="System.IO.Ports" Version="7.0.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\..\NUnit_Engine\NUnit_Engine.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Reference Include="Test_oM"> | ||
<HintPath>C:\ProgramData\BHoM\Assemblies\Test_oM.dll</HintPath> | ||
<Private>True</Private> | ||
</Reference> | ||
</ItemGroup> | ||
|
||
</Project> |
28 changes: 28 additions & 0 deletions
28
.ci/unit-tests/NUnit_TestRunner_Tests/TestsRunner_Tests.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,28 @@ | ||
using BH.oM.Test.NUnit; | ||
using NUnit.Framework; | ||
using BH.Engine.Test.NUnit; | ||
using BH.oM.Test.Results; | ||
using Newtonsoft.Json; | ||
using Shouldly; | ||
|
||
namespace NUnit_TestRunner_Tests | ||
{ | ||
public class TestsRunner_Tests | ||
{ | ||
[Test] | ||
public void Run_NUnit_Engine_Tests() | ||
{ | ||
string? solutionPath = Directory.GetParent(AppDomain.CurrentDomain.BaseDirectory)?.Parent?.Parent?.Parent?.Parent?.FullName; | ||
string NUnit_Engine_Tests_path = Path.Combine(solutionPath ?? "", "NUnit_Engine_Tests\\bin\\Debug\\net6.0\\NUnit_Engine_Tests.dll"); | ||
|
||
TestRun testRunResult = Compute.RunTests(NUnit_Engine_Tests_path); | ||
Console.WriteLine(JsonConvert.SerializeObject(testRunResult, Formatting.Indented)); | ||
|
||
TestResult testResult = testRunResult.ToTestResult(); | ||
testResult.ShouldNotBeNull(); | ||
Console.WriteLine(JsonConvert.SerializeObject(testResult, Formatting.Indented)); | ||
|
||
testRunResult.Failed.ShouldBe(1); | ||
} | ||
} | ||
} |
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