Skip to content

Commit

Permalink
tests(Language): Add test to check the language
Browse files Browse the repository at this point in the history
To not have another issue where the culture info isn't set properly
  • Loading branch information
Belphemur committed Apr 11, 2021
1 parent 8501621 commit 2a08afe
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
26 changes: 26 additions & 0 deletions SoundSwitch.Tests/LanguageTests.cs
@@ -0,0 +1,26 @@
using NUnit.Framework;
using SoundSwitch.Localization.Factory;
using SoundSwitch.Localization.Factory.Lang;

namespace SoundSwitch.Tests
{
[TestFixture]
public class LanguageTests
{
/// <summary>
/// Check that we can load the culture info of all the <see cref="ILang"/>
/// </summary>
[Test]
public void LanguageLoading()
{
var langFactory = new LanguageFactory();
Assert.DoesNotThrow(() =>
{
foreach (var lang in langFactory.AllImplementations.Values)
{
var _ = lang.CultureInfo;
}
});
}
}
}
19 changes: 19 additions & 0 deletions SoundSwitch.Tests/SoundSwitch.Tests.csproj
@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0-windows</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\SoundSwitch\SoundSwitch.csproj" />
</ItemGroup>

</Project>
10 changes: 10 additions & 0 deletions SoundSwitch.sln
Expand Up @@ -9,6 +9,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoundSwitch.Audio.Manager",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoundSwitch.Common", "SoundSwitch.Common\SoundSwitch.Common.csproj", "{45A39BFC-7B67-46F2-A6F2-59BF82B350A4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SoundSwitch.Tests", "SoundSwitch.Tests\SoundSwitch.Tests.csproj", "{997DAB74-B16F-449D-82ED-5BD966C0E4DC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
AppVeyor|Any CPU = AppVeyor|Any CPU
Expand Down Expand Up @@ -41,6 +43,14 @@ Global
{45A39BFC-7B67-46F2-A6F2-59BF82B350A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{45A39BFC-7B67-46F2-A6F2-59BF82B350A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{45A39BFC-7B67-46F2-A6F2-59BF82B350A4}.Release|Any CPU.Build.0 = Release|Any CPU
{997DAB74-B16F-449D-82ED-5BD966C0E4DC}.AppVeyor|Any CPU.ActiveCfg = Debug|Any CPU
{997DAB74-B16F-449D-82ED-5BD966C0E4DC}.AppVeyor|Any CPU.Build.0 = Debug|Any CPU
{997DAB74-B16F-449D-82ED-5BD966C0E4DC}.Beta|Any CPU.ActiveCfg = Debug|Any CPU
{997DAB74-B16F-449D-82ED-5BD966C0E4DC}.Beta|Any CPU.Build.0 = Debug|Any CPU
{997DAB74-B16F-449D-82ED-5BD966C0E4DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{997DAB74-B16F-449D-82ED-5BD966C0E4DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{997DAB74-B16F-449D-82ED-5BD966C0E4DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{997DAB74-B16F-449D-82ED-5BD966C0E4DC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 2a08afe

Please sign in to comment.