-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix test runner failing for test classes with constructor (#51)
- Loading branch information
1 parent
effa7bb
commit 3ce6f21
Showing
16 changed files
with
316 additions
and
156 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
....TestRunner.CSharp.IntegrationTests/Solutions/MultipleCompileErrors/expected_results.json
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,6 +1,6 @@ | ||
{ | ||
"version": 3, | ||
"status": "error", | ||
"message": "FakeTests.cs(5,66): error CS0117: \u0027Fake\u0027 does not contain a definition for \u0027Add\u0027\nFakeTests.cs(7,66): error CS0117: \u0027Fake\u0027 does not contain a definition for \u0027Sub\u0027", | ||
"message": "FakeTests.cs(6,66): error CS0117: \u0027Fake\u0027 does not contain a definition for \u0027Add\u0027\nFakeTests.cs(8,66): error CS0117: \u0027Fake\u0027 does not contain a definition for \u0027Sub\u0027", | ||
"tests": [] | ||
} |
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
4 changes: 4 additions & 0 deletions
4
test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/WithConstructor/.meta/Example.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,4 @@ | ||
public static class Fake | ||
{ | ||
public static int Add(int x, int y) => x + y; | ||
} |
7 changes: 7 additions & 0 deletions
7
test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/WithConstructor/.meta/config.json
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,7 @@ | ||
{ | ||
"files": { | ||
"solution": ["Fake.cs"], | ||
"test": ["FakeTests.cs"], | ||
"example": [".meta/Example.cs"] | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/WithConstructor/Fake.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,4 @@ | ||
public class Fake | ||
{ | ||
public int Add(int x, int y) => x + y; | ||
} |
18 changes: 18 additions & 0 deletions
18
test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/WithConstructor/Fake.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,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net5.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Remove="Example.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" /> | ||
<PackageReference Include="xunit" Version="2.4.1" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" /> | ||
<PackageReference Include="Exercism.Tests" Version="0.1.0-alpha" /> | ||
</ItemGroup> | ||
|
||
</Project> |
16 changes: 16 additions & 0 deletions
16
test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/WithConstructor/FakeTests.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,16 @@ | ||
using Xunit; | ||
using System.Globalization; | ||
using System.Threading; | ||
|
||
public class FakeTests | ||
{ | ||
public FakeTests() | ||
{ | ||
var enUsCulture = new CultureInfo("en-US"); | ||
Thread.CurrentThread.CurrentCulture = enUsCulture; | ||
Thread.CurrentThread.CurrentUICulture = enUsCulture; | ||
} | ||
|
||
[Fact] | ||
public void Add_should_add_numbers() => Assert.Equal(2, new Fake().Add(1, 1)); | ||
} |
11 changes: 11 additions & 0 deletions
11
...ercism.TestRunner.CSharp.IntegrationTests/Solutions/WithConstructor/expected_results.json
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,11 @@ | ||
{ | ||
"version": 3, | ||
"status": "pass", | ||
"tests": [ | ||
{ | ||
"name": "Add should add numbers", | ||
"status": "pass", | ||
"test_code": "Assert.Equal(2, Fake.Add(1, 1))" | ||
} | ||
] | ||
} |
4 changes: 4 additions & 0 deletions
4
test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/WithDisposable/.meta/Example.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,4 @@ | ||
public static class Fake | ||
{ | ||
public static int Add(int x, int y) => x + y; | ||
} |
7 changes: 7 additions & 0 deletions
7
test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/WithDisposable/.meta/config.json
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,7 @@ | ||
{ | ||
"files": { | ||
"solution": ["Fake.cs"], | ||
"test": ["FakeTests.cs"], | ||
"example": [".meta/Example.cs"] | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/WithDisposable/Fake.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,4 @@ | ||
public class Fake | ||
{ | ||
public int Add(int x, int y) => x + y; | ||
} |
18 changes: 18 additions & 0 deletions
18
test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/WithDisposable/Fake.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,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net5.0</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Remove="Example.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" /> | ||
<PackageReference Include="xunit" Version="2.4.1" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" /> | ||
<PackageReference Include="Exercism.Tests" Version="0.1.0-alpha" /> | ||
</ItemGroup> | ||
|
||
</Project> |
22 changes: 22 additions & 0 deletions
22
test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/WithDisposable/FakeTests.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,22 @@ | ||
using System; | ||
|
||
using Xunit; | ||
using System.IO; | ||
|
||
public class FakeTests : IDisposable | ||
{ | ||
private FileStream _file; | ||
|
||
public FakeTests() | ||
{ | ||
_file = File.Open("tmp.txt", FileMode.Create); | ||
} | ||
|
||
[Fact] | ||
public void Add_should_add_numbers() => Assert.Equal(2, new Fake().Add(1, 1)); | ||
|
||
public void Dispose() | ||
{ | ||
_file.Dispose(); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...xercism.TestRunner.CSharp.IntegrationTests/Solutions/WithDisposable/expected_results.json
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,11 @@ | ||
{ | ||
"version": 3, | ||
"status": "pass", | ||
"tests": [ | ||
{ | ||
"name": "Add should add numbers", | ||
"status": "pass", | ||
"test_code": "Assert.Equal(2, Fake.Add(1, 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