Add unit test for gettext parser.

This commit is contained in:
2019-05-24 00:28:41 +01:00
parent b56eb104dc
commit 11686ccd91
6 changed files with 4896 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/Claunia.Localization.Test/gettext/es_ES.po" charset="ISO-8859-1" />
</component>
</project>

View File

@@ -2,6 +2,9 @@
<module type="RIDER_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$USER_HOME$/.nuget/packages/nunit3testadapter/3.11.0/build/netcoreapp1.0/NUnit3.TestAdapter.dll" />
<content url="file://$USER_HOME$/.nuget/packages/nunit3testadapter/3.11.0/build/netcoreapp1.0/NUnit3.TestAdapter.pdb" />
<content url="file://$USER_HOME$/.nuget/packages/nunit3testadapter/3.11.0/build/netcoreapp1.0/nunit.engine.netstandard.dll" />
<content url="file://$MODULE_DIR$/../.." />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="R User Library" level="project" />

View File

@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="nunit" Version="3.11.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
</ItemGroup>
<ItemGroup>
<None Update="gettext\es_ES.po">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Claunia.Localization.Parsers\Claunia.Localization.Parsers.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,18 @@
using System.IO;
using System.Text;
using NUnit.Framework;
namespace Claunia.Localization.Test.gettext
{
[TestFixture]
public sealed class Test
{
[Test]
public void Parse()
{
var testPath = Path.Combine(".", "gettext","es_ES.po");
var localization = Claunia.Localization.Parsers.GetText.Parse(testPath, Encoding.GetEncoding("iso8859-1"));
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -6,6 +6,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Claunia.Localization.Deskto
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Claunia.Localization.Core", "Claunia.Localization.Core\Claunia.Localization.Core.csproj", "{CFDFDFC7-9662-4C50-B86A-9E579ACD3DF9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Claunia.Localization.Parsers", "Claunia.Localization.Parsers\Claunia.Localization.Parsers.csproj", "{8660FA2F-618D-4CD2-ABD2-31C5FD4EB2B2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Claunia.Localization.Test", "Claunia.Localization.Test\Claunia.Localization.Test.csproj", "{76FBD8F7-6AF7-405B-B8F8-3D2F5C655ADD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -26,5 +30,13 @@ Global
{CFDFDFC7-9662-4C50-B86A-9E579ACD3DF9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CFDFDFC7-9662-4C50-B86A-9E579ACD3DF9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CFDFDFC7-9662-4C50-B86A-9E579ACD3DF9}.Release|Any CPU.Build.0 = Release|Any CPU
{8660FA2F-618D-4CD2-ABD2-31C5FD4EB2B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8660FA2F-618D-4CD2-ABD2-31C5FD4EB2B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8660FA2F-618D-4CD2-ABD2-31C5FD4EB2B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8660FA2F-618D-4CD2-ABD2-31C5FD4EB2B2}.Release|Any CPU.Build.0 = Release|Any CPU
{76FBD8F7-6AF7-405B-B8F8-3D2F5C655ADD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{76FBD8F7-6AF7-405B-B8F8-3D2F5C655ADD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{76FBD8F7-6AF7-405B-B8F8-3D2F5C655ADD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76FBD8F7-6AF7-405B-B8F8-3D2F5C655ADD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal