-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUseCultureAttributeTests.cs
More file actions
40 lines (36 loc) · 1.14 KB
/
UseCultureAttributeTests.cs
File metadata and controls
40 lines (36 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using System.Globalization;
using Xunit;
namespace Exercism.Tests.Tests
{
[UseCulture("en-US")]
public class UseCultureAttributeTests
{
[Fact]
[UseCulture("nl-NL")]
public void SpecifyCulture()
{
Assert.Equal("nl-NL", CultureInfo.CurrentCulture.Name);
Assert.Equal("nl-NL", CultureInfo.CurrentUICulture.Name);
}
[Fact]
[UseCulture("nl-NL", "nl-BE")]
public void SpecifyCultureAndUiCulture()
{
Assert.Equal("nl-NL", CultureInfo.CurrentCulture.Name);
Assert.Equal("nl-BE", CultureInfo.CurrentUICulture.Name);
}
[Fact]
[UseCulture]
public void DontSpecifyCulture()
{
Assert.Equal(CultureInfo.InvariantCulture, CultureInfo.CurrentCulture);
Assert.Equal(CultureInfo.InvariantCulture, CultureInfo.CurrentUICulture);
}
[Fact]
public void InheritCultureFromClass()
{
Assert.Equal("en-US", CultureInfo.CurrentCulture.Name);
Assert.Equal("en-US", CultureInfo.CurrentUICulture.Name);
}
}
}