示例#1
0
        public void ReverseWordsTest5()
        {
            string originStr = string.Empty;
            string expected  = string.Empty;

            string reversedStr = new ReverseWordsInAString().ReverseWords(originStr);

            Assert.AreEqual(expected, reversedStr);
        }
示例#2
0
        public void ReverseWordsTest4()
        {
            string originStr = "    aaaaa  ";
            string expected  = "aaaaa";

            string reversedStr = new ReverseWordsInAString().ReverseWords(originStr);

            Assert.AreEqual(expected, reversedStr);
        }
示例#3
0
        public void ReverseWordsTest1()
        {
            string originStr = "  hello   world!  ";
            string expected  = "world! hello";

            string reversedStr = new ReverseWordsInAString().ReverseWords(originStr);

            Assert.AreEqual(expected, reversedStr);
        }
示例#4
0
        public void ReverseWordsTest()
        {
            string originStr = "the sky is blue";
            string expected  = "blue is sky the";

            string reversedStr = new ReverseWordsInAString().ReverseWords(originStr);

            Assert.AreEqual(expected, reversedStr);
        }
 public void reverseWordsInAStringTest()
 {
     foreach (ReverseWordsInAStringTestData testData in TestDataList)
     {
         Console.WriteLine("Testing => Input: " + testData.InputString + "; Output: " +
                           ReverseWordsInAString.ReverseWords(testData.InputString) +
                           "; Expected Output: " + testData.OutputString);
         Assert.AreEqual(ReverseWordsInAString.ReverseWords(testData.InputString),
                         testData.OutputString, "Failed on the case: " + testData.InputString);
         Assert.AreEqual(ReverseWordsInAString.ReverseWordsG(testData.InputString),
                         testData.OutputString, "Failed on the case: " + testData.InputString);
         Assert.AreEqual(ReverseWordsInAString.ReverseWordsGG(testData.InputString),
                         testData.OutputString, "Failed on the case: " + testData.InputString);
     }
 }
示例#6
0
        public void ReverseWordsTest(string v1, string v2)
        {
            ReverseWordsInAString test = new ReverseWordsInAString();

            Assert.AreEqual(test.ReverseWords(v1), v2);
        }