Skip to content
This repository has been archived by the owner on Aug 13, 2020. It is now read-only.

Commit

Permalink
Merged master into add-portuguese
Browse files Browse the repository at this point in the history
  • Loading branch information
tgnm committed Feb 25, 2016
2 parents c23bfb8 + a449634 commit 0e0a3ee
Show file tree
Hide file tree
Showing 18 changed files with 934 additions and 34 deletions.
19 changes: 19 additions & 0 deletions Numsense.UnitTests.CSharp/Demo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,24 @@ public void ConvertIntegerToDanish()
var danishNumeral = Numeral.Danish.ToNumeral(9);
Assert.Equal("ni", danishNumeral);
}

[Fact]
public void ConvertIntegerToBulgarian()
{
var bulgarianNumeral = Numeral.Bulgarian.ToNumeral(21);
Assert.Equal("двайсет-и-едно", bulgarianNumeral);
}

[Fact]
public void ParseBulgarianNumeralToInteger()
{
int i;
var success = Numeral.Bulgarian.TryParse(
"четиресет и две",
out i);

Assert.True(success);
Assert.Equal(42, i);
}
}
}
28 changes: 16 additions & 12 deletions Numsense.UnitTests.CSharp/NumeralConverterProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ public static Arbitrary<ConverterPropertyGroup> Converter()
NumeralModule.toDanish,
NumeralModule.tryParseDanish),
new ConverterPropertyGroup(
new FarsiNumeralConverter(),
NumeralModule.toFarsi,
NumeralModule.tryParseFarsi),
new ConverterPropertyGroup(
new FarsiNumeralConverter(),
NumeralModule.toFarsi,
NumeralModule.tryParseFarsi),
new ConverterPropertyGroup(
new PolishNumeralConverter(),
NumeralModule.toPolish,
NumeralModule.tryParsePolish),
Expand All @@ -91,14 +91,18 @@ public static Arbitrary<ConverterPropertyGroup> Converter()
new ConverterPropertyGroup(
new RussianNumeralConverter(),
NumeralModule.toRussian,
NumeralModule.tryParseRussian),
new ConverterPropertyGroup(
new CatalanNumeralConverter(),
NumeralModule.toCatalan,
NumeralModule.tryParseCatalan),
new ConverterPropertyGroup(
new SwedishNumeralConverter(),
NumeralModule.toSwedish,
NumeralModule.tryParseRussian),
new ConverterPropertyGroup(
new SpanishNumeralConverter(),
NumeralModule.toSpanish,
NumeralModule.tryParseSpanish),
new ConverterPropertyGroup(
new CatalanNumeralConverter(),
NumeralModule.toCatalan,
NumeralModule.tryParseCatalan),
new ConverterPropertyGroup(
new SwedishNumeralConverter(),
NumeralModule.toSwedish,
NumeralModule.tryParseSwedish),
new ConverterPropertyGroup(
new RomanianNumeralConverter(),
Expand Down
31 changes: 31 additions & 0 deletions Numsense.UnitTests.CSharp/NumeralTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ namespace Ploeh.Numsense.UnitTests
{
public class NumeralTests
{
[Fact]
public void BulgarianIsCorrect()
{
var actual = Numeral.Bulgarian;
Assert.IsAssignableFrom<BulgarianNumeralConverter>(actual);
}

[Fact]
public void BulgarianIsSingleton()
{
var expected = Numeral.Bulgarian;
var actual = Numeral.Bulgarian;
Assert.Same(expected, actual);
}

[Fact]
public void EnglishIsCorrect()
{
Expand Down Expand Up @@ -47,6 +62,7 @@ public void FarsiIsSingleton()
{
var expected = Numeral.Farsi;
var actual = Numeral.Farsi;

Assert.Same(expected, actual);
}

Expand Down Expand Up @@ -109,6 +125,21 @@ public void RussianIsSingleton()
Assert.Same(expected, actual);
}

[Fact]
public void SpanishIsCorrect()
{
var actual = Numeral.Spanish;
Assert.IsAssignableFrom<SpanishNumeralConverter>(actual);
}

[Fact]
public void SpanishIsSingleton()
{
var expected = Numeral.Spanish;
var actual = Numeral.Spanish;
Assert.Same(expected, actual);
}

[Fact]
public void CatalanIsCorrect()
{
Expand Down
3 changes: 3 additions & 0 deletions Numsense.UnitTests.CSharp/Numsense.UnitTests.CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
<Name>Numsense</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
Expand Down
4 changes: 2 additions & 2 deletions Numsense.UnitTests.CSharp/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.9.0.0")]
[assembly: AssemblyFileVersion("0.9.0.0")]
[assembly: AssemblyVersion("0.11.0.0")]
[assembly: AssemblyFileVersion("0.11.0.0")]
6 changes: 3 additions & 3 deletions Numsense.UnitTests.CSharp/app.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0"/>
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
4 changes: 2 additions & 2 deletions Numsense.UnitTests/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ open System.Runtime.InteropServices
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [<assembly: AssemblyVersion("1.0.*")>]
[<assembly: AssemblyVersion("0.9.0.0")>]
[<assembly: AssemblyFileVersion("0.9.0.0")>]
[<assembly: AssemblyVersion("0.11.0.0")>]
[<assembly: AssemblyFileVersion("0.11.0.0")>]

do
()
Loading

0 comments on commit 0e0a3ee

Please sign in to comment.