Esempio n. 1
0
        public void Test_ZeroDollars()
        {
            //Arrange
            string inputValue    = "0";
            string expectedValue = "zero dollars";

            CurrencyConverterService.CurrencyConverter currencyConverter = new CurrencyConverterService.CurrencyConverter();

            //Act
            string actualValue = currencyConverter.GetResult(inputValue);

            //Assert
            Assert.AreEqual(expectedValue, actualValue);
        }
Esempio n. 2
0
        public void Test_OnlyDollars()
        {
            //Arrange
            string inputValue    = "45100";
            string expectedValue = "forty-five thousand one hundred  dollars";

            CurrencyConverterService.CurrencyConverter currencyConverter = new CurrencyConverterService.CurrencyConverter();

            //Act
            string actualValue = currencyConverter.GetResult(inputValue);

            //Assert
            Assert.AreEqual(expectedValue, actualValue);
        }
Esempio n. 3
0
        public void Test_NegativeInput()
        {
            //Arrange
            string inputValue    = "-25";
            string expectedValue = "Input in not is correct format";

            CurrencyConverterService.CurrencyConverter currencyConverter = new CurrencyConverterService.CurrencyConverter();

            //Act
            string actualValue = currencyConverter.GetResult(inputValue);

            //Assert
            Assert.AreEqual(expectedValue, actualValue);
        }
Esempio n. 4
0
        public void Test_DollarWIthCents()
        {
            //Arrange
            string inputValue    = "25,1";
            string expectedValue = "twenty-five dollars and ten cents";

            CurrencyConverterService.CurrencyConverter currencyConverter = new CurrencyConverterService.CurrencyConverter();

            //Act
            string actualValue = currencyConverter.GetResult(inputValue);

            //Assert
            Assert.AreEqual(expectedValue, actualValue);
        }
Esempio n. 5
0
        public void Test_OutOfRangeForDollars()
        {
            //Arrange
            string inputValue    = "1000000000";
            string expectedValue = "Input is Out of Range";

            CurrencyConverterService.CurrencyConverter currencyConverter = new CurrencyConverterService.CurrencyConverter();

            //Act
            string actualValue = currencyConverter.GetResult(inputValue);

            //Assert
            Assert.AreEqual(expectedValue, actualValue);
        }
Esempio n. 6
0
        public void Test_OutOfRange()
        {
            //Arrange
            //The below input is out of range cause, cents should only occupy only 2 places.
            string inputValue    = "25,9876";
            string expectedValue = "Input is Out of Range";

            CurrencyConverterService.CurrencyConverter currencyConverter = new CurrencyConverterService.CurrencyConverter();

            //Act
            string actualValue = currencyConverter.GetResult(inputValue);

            //Assert
            Assert.AreEqual(expectedValue, actualValue);
        }