Beispiel #1
0
        public void Empty_String_Should_Return_Empty_String()
        {
            // Arrange
            var solution = new ReverseWordsInAStringSolution();
            var expected = string.Empty;

            //act
            var result = solution.ReverseWords(string.Empty);

            //Assert
            Assert.Equal(expected, result);
        }
Beispiel #2
0
        public void One_Word_Int_String()
        {
            // Arrange
            var solution = new ReverseWordsInAStringSolution();
            var expected = "blue";

            //act
            var result = solution.ReverseWords("blue");

            //Assert
            Assert.Equal(expected, result);
        }
Beispiel #3
0
        public void String_With_Few_Leading_And_Trailing_Spaces()
        {
            // Arrange
            var solution = new ReverseWordsInAStringSolution();
            var expected = "blue is sky the";

            //act
            var result = solution.ReverseWords(" the sky is blue ");

            //Assert
            Assert.Equal(expected, result);
        }
Beispiel #4
0
        public void String_With_Few_Spaces_In_The_Middle_Of_The_String()
        {
            // Arrange
            var solution = new ReverseWordsInAStringSolution();
            var expected = "blue is sky the";

            //act
            var result = solution.ReverseWords("the sky is   blue");

            //Assert
            Assert.Equal(expected, result);
        }
Beispiel #5
0
        public void Common_Test_Should_Return_Proper_Result()
        {
            // Arrange
            var solution = new ReverseWordsInAStringSolution();
            var expected = "blue is sky the";

            //act
            var result = solution.ReverseWords("the sky is blue");

            //Assert
            Assert.Equal(expected, result);
        }