Пример #1
0
        public void InvalidInputTest()
        {
            // Null input
            TestHelpers.AssertExceptionThrown(() => { Question1_9.IsRotation("abc", null); }, typeof(ArgumentException));
            TestHelpers.AssertExceptionThrown(() => { Question1_9.IsRotation(null, "abc"); }, typeof(ArgumentException));
            TestHelpers.AssertExceptionThrown(() => { Question1_9.IsRotation(null, null); }, typeof(ArgumentException));

            // Empty input
            TestHelpers.AssertExceptionThrown(() => { Question1_9.IsRotation("abc", string.Empty); }, typeof(ArgumentException));
            TestHelpers.AssertExceptionThrown(() => { Question1_9.IsRotation(string.Empty, "abc"); }, typeof(ArgumentException));
            TestHelpers.AssertExceptionThrown(() => { Question1_9.IsRotation(string.Empty, string.Empty); }, typeof(ArgumentException));
        }
Пример #2
0
 private static void ValidateResult(string s1, string s2, bool expectedResult)
 {
     Assert.AreEqual(expectedResult, Question1_9.IsRotation(s1, s2));
 }