Exemple #1
0
        public void GetPathnameOfCurrencyImageWithPennyTest()
        {
            var denom     = new CurrencyPenny();
            var tillMoney = new TillMoney
            {
                Name = denom.Name,
            };
            var expected = "~/images/Penny.png";

            var actual = DisplayCurrency.GetPathameOfCurrencyImage(tillMoney);

            Assert.AreEqual(expected, actual);
        }
Exemple #2
0
        public void GetPathnameOfCurrencyImageWithPennyAndValsFromZeroToTenThousandTest()
        {
            var denom = new CurrencyPenny();

            for (int i = 0; i < 10001; i++)
            {
                var tillMoney = new TillMoney
                {
                    Name       = denom.Name,
                    Val        = i,
                    PluralName = denom.PluralName
                };
                var expected = i <= 4 ? "~/images/Penny.png" : "~/images/Pennies.png";

                var actual = DisplayCurrency.GetPathameOfCurrencyImage(tillMoney);

                Assert.AreEqual(expected, actual);
            }
        }