-
Notifications
You must be signed in to change notification settings - Fork 966
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed the NumberToWords Converter to find the right converter by the language Name as well #174
Changes from 3 commits
9db1f7d
21d9916
f01facb
f4747ae
5c96a6f
38ec864
75b03d8
2c84c1e
8f9a477
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Xunit; | ||
|
||
namespace Humanizer.Tests.Localisation | ||
{ | ||
public class NumerToWordsFactoryTests | ||
{ | ||
[Fact] | ||
public void CanGetRFCStandardLanguageSpecificFactory() | ||
{ | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove redundant spaces. |
||
using (new AmbientCulture("pt-BR")) | ||
{ | ||
string retorno = 1000000000.ToWords(); | ||
Assert.NotEqual("1000000000",retorno); | ||
} | ||
} | ||
|
||
[Fact] | ||
public void CanGetTwoLetterISOLanguageSpecificFactory() | ||
{ | ||
|
||
using (new AmbientCulture("ar")) | ||
{ | ||
string retorno = 1000000000.ToWords(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please also inline the assertions. |
||
Assert.NotEqual("1000000000", retorno); | ||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
|
||
namespace Humanizer.Localisation.NumberToWords | ||
{ | ||
internal class BrazilianPortugueseNumberToWordsConverter : DefaultNumberToWordsConverter | ||
{ | ||
public override string Convert(int number) | ||
{ | ||
return "not implemented"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will upset Brazilian users I believe. We need to implement this first. |
||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some tests to verify the logic works for pt-PT and pt-BR.