Ejemplo n.º 1
0
        public void Match_NonExistingKeyWithLanguageDefined_ReturnUnknown()
        {
            var currencyLookup = new CurrencyLookup("fr");

            currencyLookup.Load();
            var currency = currencyLookup.Match("XXX");

            Assert.That(currency, Is.EqualTo("Unknown"));
        }
Ejemplo n.º 2
0
        public void Match_ExistingKeyWithLanguageDefined_ReturnValue()
        {
            var currencyLookup = new CurrencyLookup("fr");

            currencyLookup.Load();
            var currency = currencyLookup.Match("USD");

            Assert.That(currency, Is.EqualTo("Dollar américain"));
        }
Ejemplo n.º 3
0
        public void Match_NonExistingKeyTwice_ReturnTwoUnknownWithSameReference()
        {
            var currencyLookup = new CurrencyLookup();

            currencyLookup.Load();
            var firstCurrency  = currencyLookup.Match("XXX");
            var secondCurrency = currencyLookup.Match("YYY");

            Assert.That(firstCurrency, Is.EqualTo(secondCurrency));
        }
Ejemplo n.º 4
0
        public void Match_NonExistingKey_ReturnUnknown()
        {
            var currencyLookup = new CurrencyLookup();

            currencyLookup.Load();
            var currency = currencyLookup.Match("XXX");

            Assert.That(currency.English, Is.EqualTo("Unknown"));
            Assert.That(currency.French, Is.EqualTo("Inconnu"));
        }
Ejemplo n.º 5
0
        public void Match_ExistingKey_ReturnValue()
        {
            var currencyLookup = new CurrencyLookup();

            currencyLookup.Load();
            var currency = currencyLookup.Match("USD");

            Assert.That(currency.English, Is.EqualTo("US Dollar"));
            Assert.That(currency.French, Is.EqualTo("Dollar américain"));
        }
 public static string GetCurrencyName(Money money)
 {
     return(CurrencyLookup.GetCurrencyName(money.Currency));
 }