Skip to content

Commit 2a08afe

Browse files
committed
tests(Language): Add test to check the language
To not have another issue where the culture info isn't set properly
1 parent 8501621 commit 2a08afe

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

SoundSwitch.Tests/LanguageTests.cs

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using NUnit.Framework;
2+
using SoundSwitch.Localization.Factory;
3+
using SoundSwitch.Localization.Factory.Lang;
4+
5+
namespace SoundSwitch.Tests
6+
{
7+
[TestFixture]
8+
public class LanguageTests
9+
{
10+
/// <summary>
11+
/// Check that we can load the culture info of all the <see cref="ILang"/>
12+
/// </summary>
13+
[Test]
14+
public void LanguageLoading()
15+
{
16+
var langFactory = new LanguageFactory();
17+
Assert.DoesNotThrow(() =>
18+
{
19+
foreach (var lang in langFactory.AllImplementations.Values)
20+
{
21+
var _ = lang.CultureInfo;
22+
}
23+
});
24+
}
25+
}
26+
}
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFramework>net5.0-windows</TargetFramework>
5+
6+
<IsPackable>false</IsPackable>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="NUnit" Version="3.12.0" />
11+
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
13+
</ItemGroup>
14+
15+
<ItemGroup>
16+
<ProjectReference Include="..\SoundSwitch\SoundSwitch.csproj" />
17+
</ItemGroup>
18+
19+
</Project>

SoundSwitch.sln

+10
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoundSwitch.Audio.Manager",
99
EndProject
1010
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoundSwitch.Common", "SoundSwitch.Common\SoundSwitch.Common.csproj", "{45A39BFC-7B67-46F2-A6F2-59BF82B350A4}"
1111
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoundSwitch.Tests", "SoundSwitch.Tests\SoundSwitch.Tests.csproj", "{997DAB74-B16F-449D-82ED-5BD966C0E4DC}"
13+
EndProject
1214
Global
1315
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1416
AppVeyor|Any CPU = AppVeyor|Any CPU
@@ -41,6 +43,14 @@ Global
4143
{45A39BFC-7B67-46F2-A6F2-59BF82B350A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
4244
{45A39BFC-7B67-46F2-A6F2-59BF82B350A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
4345
{45A39BFC-7B67-46F2-A6F2-59BF82B350A4}.Release|Any CPU.Build.0 = Release|Any CPU
46+
{997DAB74-B16F-449D-82ED-5BD966C0E4DC}.AppVeyor|Any CPU.ActiveCfg = Debug|Any CPU
47+
{997DAB74-B16F-449D-82ED-5BD966C0E4DC}.AppVeyor|Any CPU.Build.0 = Debug|Any CPU
48+
{997DAB74-B16F-449D-82ED-5BD966C0E4DC}.Beta|Any CPU.ActiveCfg = Debug|Any CPU
49+
{997DAB74-B16F-449D-82ED-5BD966C0E4DC}.Beta|Any CPU.Build.0 = Debug|Any CPU
50+
{997DAB74-B16F-449D-82ED-5BD966C0E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
51+
{997DAB74-B16F-449D-82ED-5BD966C0E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
52+
{997DAB74-B16F-449D-82ED-5BD966C0E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
53+
{997DAB74-B16F-449D-82ED-5BD966C0E4DC}.Release|Any CPU.Build.0 = Release|Any CPU
4454
EndGlobalSection
4555
GlobalSection(SolutionProperties) = preSolution
4656
HideSolutionNode = FALSE

0 commit comments

Comments
 (0)