예제 #1
0
        public void EmptyStringTest()
        {
            var expected = "".ToCharArray();
            var actual   = "".ToCharArray();

            ReverseInPlace.ReverseWords(actual);
            Assert.Equal(expected, actual);
        }
예제 #2
0
        public void MultipleWordsDifferentLengthsTest()
        {
            var expected = "chocolate bundt cake is yummy".ToCharArray();
            var actual   = "yummy is cake bundt chocolate".ToCharArray();

            ReverseInPlace.ReverseWords(actual);
            Assert.Equal(expected, actual);
        }
예제 #3
0
        public void MultipleWordsSameLengthTest()
        {
            var expected = "the cat ate the rat".ToCharArray();
            var actual   = "rat the ate cat the".ToCharArray();

            ReverseInPlace.ReverseWords(actual);
            Assert.Equal(expected, actual);
        }
예제 #4
0
        public void ThreeWordsTest()
        {
            var expected = "get another one".ToCharArray();
            var actual   = "one another get".ToCharArray();

            ReverseInPlace.ReverseWords(actual);
            Assert.Equal(expected, actual);
        }
예제 #5
0
        public void TwoWordsTest()
        {
            var expected = "cake thief".ToCharArray();
            var actual   = "thief cake".ToCharArray();

            ReverseInPlace.ReverseWords(actual);
            Assert.Equal(expected, actual);
        }
예제 #6
0
        public void OneWordTest()
        {
            var expected = "vault".ToCharArray();
            var actual   = "vault".ToCharArray();

            ReverseInPlace.ReverseWords(actual);
            Assert.Equal(expected, actual);
        }