예제 #1
0
        private void AssertFalse(string s1, string s2, IStringRotationChecker stringRotationChecker)
        {
            bool expected = false;
            bool actual   = stringRotationChecker.IsRotatedString(s1, s2);

            Assert.AreEqual(expected, actual);
        }
예제 #2
0
        private void IsNotRotatedStringDifferentTail(IStringRotationChecker stringRotationChecker)
        {
            string s1 = "iamastring";
            string s2 = "astringino";

            AssertFalse(s1, s2, stringRotationChecker);
        }
예제 #3
0
        private void IsNotStringRotationSameLength(IStringRotationChecker stringRotationChecker)
        {
            string s1 = "iamastring";
            string s2 = "thisisgarb";

            AssertFalse(s1, s2, stringRotationChecker);
        }
예제 #4
0
 private void RunTests(IStringRotationChecker stringRotationChecker)
 {
     IsStringRotation(stringRotationChecker);
     IsNotStringRotation(stringRotationChecker);
     IsNotStringRotationSameLength(stringRotationChecker);
     IsNotRotatedStringDifferentTail(stringRotationChecker);
 }
예제 #5
0
        private void IsStringRotation(IStringRotationChecker stringRotationChecker)
        {
            string s1 = "iamastring";
            string s2 = "astringiam";

            bool expected = true;
            bool actual   = stringRotationChecker.IsRotatedString(s1, s2);

            Assert.AreEqual(expected, actual);
        }