-
Notifications
You must be signed in to change notification settings - Fork 152
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set
AppContext.BaseDirectory
when running under .NET 8.0
- Loading branch information
1 parent
9325458
commit c0bf856
Showing
6 changed files
with
79 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt | ||
|
||
using System; | ||
using System.IO; | ||
using NUnit.Framework; | ||
|
||
namespace NUnit.Engine.Core.Tests | ||
{ | ||
public class AppContextTest | ||
{ | ||
[Test] | ||
public void VerifyBasePath() | ||
{ | ||
var thisAssembly = GetType().Assembly; | ||
var expectedPath = Path.GetDirectoryName(GetType().Assembly.Location); | ||
|
||
Assert.That(AppContext.BaseDirectory, Is.SamePath(expectedPath)); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt | ||
|
||
using System; | ||
using System.IO; | ||
using NUnit.Framework; | ||
|
||
namespace NUnit.Engine.Core.Tests | ||
{ | ||
public class AppContextTest | ||
{ | ||
[Test] | ||
public void VerifyBasePath() | ||
{ | ||
var thisAssembly = GetType().Assembly; | ||
var expectedPath = Path.GetDirectoryName(GetType().Assembly.Location); | ||
|
||
Assert.That(AppContext.BaseDirectory, Is.SamePath(expectedPath)); | ||
} | ||
} | ||
} |
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,16 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net462;netcoreapp3.1;net6.0;net8.0</TargetFrameworks> | ||
<OutputPath>..\..\..\bin\$(Configuration)\testdata\</OutputPath> | ||
</PropertyGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)'=='netcoreapp3.1'"> | ||
<PackageReference Include="nunit" Version="3.14.0" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition="'$(TargetFramework)'!='netcoreapp3.1'"> | ||
<PackageReference Include="nunit" Version="4.2.2" /> | ||
</ItemGroup> | ||
|
||
</Project> |