Example #1
0
        public void OnConvert_WhenInputIntegersFromOneToTen_ShouldPrintCorrespondingWordOfEachNumber()
        {
            //Arrange
            IList <String> expected = new List <String> {
                "Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten"
            };
            IList <int> numbers = new List <int> {
                0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
            };

            //Act
            var words = _sut.Convert(numbers);

            //Assert
            Assert.AreEqual(numbers.Count, words.Count);
            Assert.AreEqual(expected, words);
        }
        public void OnConvert_WhenValidNumberListProvided_ShouldReturnsNumbersAsWords()
        {
            // arrange
            List <int> numbers = new List <int> {
                1, 2, 3
            };

            // Act
            var result = _sut.Convert(numbers);

            // Assert
            Assert.AreEqual(result.Count, 3);
        }
Example #3
0
        public void OnConvert_WhenInputIntegersFromOneToNineteen_ShouldPrintCorrespondingWordOfEachNumber()
        {
            //arrange
            IList <string> expected = new List <string> {
                "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"
            };
            List <int> numbers = new List <int> {
                1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
            };
            //act
            var words = _sut.Convert(numbers);

            //assert
            Assert.AreEqual(numbers.Count, words.Count, "1. Number of items in input and output are equal.");
            Assert.AreEqual(expected, words, "2. Numbers are converted to words.");
        }