Skip to content

Commit

Permalink
fix(test): test project directory path is wrong in .NET 4.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
GiuseppePiscopo committed Feb 17, 2017
1 parent dd6c570 commit 65d6223
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sln/test/NSpec.Tests/Api/ApiTestData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ static ApiTestData()
{
string thisAssemblyPath = typeof(ApiTestData).GetTypeInfo().Assembly.Location;

// go up from test\{Project}\bin\{Config}\{Framework}\{Assembly}.dll
// .NET Core: go up from test\{Project}\bin\{Config}\{Framework}\{Assembly}.dll
// .NET Framework: go up from test\{Project}\bin\{Config}\{Framework}\{Platform}\{Assembly}.dll
string testDirPath = Directory
.GetParent(thisAssemblyPath)
.Parent
.Parent
.Parent
#if NET451
.Parent
#endif
.Parent.FullName;

string singleTestSourceFilePath = Path.Combine(new[]
Expand Down Expand Up @@ -161,7 +165,7 @@ static ApiTestData()
Failed = true,
Pending = false,
ExceptionMessage = "Expected false, but was $True.",
ExceptionStackTrace = "at NSpec.AssertionExtensions.ShouldBeFalse(Boolean actual)",
ExceptionStackTrace = "NSpec.AssertionExtensions.ShouldBeFalse(Boolean actual)",
},
new ExecutedExample()
{
Expand Down

0 comments on commit 65d6223

Please sign in to comment.