-
-
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.
- Loading branch information
1 parent
853ec2c
commit f45543c
Showing
7 changed files
with
75 additions
and
1 deletion.
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
7 changes: 7 additions & 0 deletions
7
...ercism.TestRunner.CSharp.IntegrationTests/Solutions/UseCultureAttribute/.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/UseCultureAttribute/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 static class Fake | ||
{ | ||
public static string Format(int x) => x.ToString("c"); | ||
} |
18 changes: 18 additions & 0 deletions
18
test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/UseCultureAttribute/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-beta1" /> | ||
</ItemGroup> | ||
|
||
</Project> |
17 changes: 17 additions & 0 deletions
17
test/Exercism.TestRunner.CSharp.IntegrationTests/Solutions/UseCultureAttribute/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,17 @@ | ||
using Xunit; | ||
using Exercism.Tests; | ||
|
||
public class FakeTests | ||
{ | ||
[Fact] | ||
[UseCulture] | ||
public void Use_invariant_culture() => Assert.Equal("¤1,000.00", Fake.Format(1000)); | ||
|
||
[Fact] | ||
[UseCulture("nl-NL")] | ||
public void Use_dutch_culture() => Assert.Equal("€ 1.000,00", Fake.Format(1000)); | ||
|
||
[Fact] | ||
[UseCulture("en-US")] | ||
public void Use_us_culture() => Assert.Equal("$1,000.00", Fake.Format(1000)); | ||
} |
21 changes: 21 additions & 0 deletions
21
...sm.TestRunner.CSharp.IntegrationTests/Solutions/UseCultureAttribute/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,21 @@ | ||
{ | ||
"version": 3, | ||
"status": "pass", | ||
"tests": [ | ||
{ | ||
"name": "Use invariant culture", | ||
"status": "pass", | ||
"test_code": "Assert.Equal(\"¤1,000.00\", Fake.Format(1000))" | ||
}, | ||
{ | ||
"name": "Use dutch culture", | ||
"status": "pass", | ||
"test_code": "Assert.Equal(\"€ 1.000,00\", Fake.Format(1000))" | ||
}, | ||
{ | ||
"name": "Use us culture", | ||
"status": "pass", | ||
"test_code": "Assert.Equal(\"€ 1.000,00\", Fake.Format(1000))" | ||
} | ||
] | ||
} |
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