Example #1
0
        public void ShouldProcessRequestWithoutDecimal()
        {
            Person person = new Person();

            person.Name          = "Jebin Babu George";
            person.Salary        = 123;
            person.SalaryInWords = "";

            string expected = "ONE HUNDRED AND TWENTY-THREE DOLLARS";

            ConvertNumberToWord ctnw = new ConvertNumberToWord();

            string actual = ctnw.GetSalaryInWords(person.Salary);

            Assert.AreEqual(expected, actual);
        }
Example #2
0
        public void ShouldProcessRequestInMillions()
        {
            Person person = new Person();

            person.Name          = "Jebin Babu George";
            person.Salary        = 1231231;
            person.SalaryInWords = "";

            string expected = "ONE MILLION TWO HUNDRED AND THIRTY-ONE THOUSAND TWO HUNDRED AND THIRTY-ONE DOLLARS";

            ConvertNumberToWord ctnw = new ConvertNumberToWord();

            string actual = ctnw.GetSalaryInWords(person.Salary);

            Assert.AreEqual(expected, actual);
        }
Example #3
0
        public void ShouldProcessZeroRequest()
        {
            Person person = new Person();

            person.Name          = "Jebin Babu George";
            person.Salary        = 0;
            person.SalaryInWords = "";

            string expected = "ZERO DOLLARS";

            ConvertNumberToWord ctnw = new ConvertNumberToWord();

            string actual = ctnw.GetSalaryInWords(person.Salary);

            Assert.AreEqual(expected, actual);
        }