public void WithNoInnerExceptionFailTest() { new ExceptionAssertion( FailureHandler.Object, new Exception(string.Empty, new Exception())).WithNoInnerException(); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once()); }
public void WithMessageFailTest() { string msg = "4356543rf"; new ExceptionAssertion(FailureHandler.Object, new Exception()).WithMessage(msg); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once()); }
public void WithMessagePassTest() { string msg = "t2fdres4"; new ExceptionAssertion(FailureHandler.Object, new Exception(msg)).WithMessage(msg); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never()); }
public void WithInnerExceptionSpecificNoneFailTest() { ExceptionAssertion assertion = new ExceptionAssertion( FailureHandler.Object, new Exception(string.Empty)).WithInnerException <ArgumentException>(); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once()); Assert.Null(assertion); }
public void WithInnerExceptionSpecificPassTest() { ArgumentException inner = new ArgumentException(string.Empty); ExceptionAssertion assertion = new ExceptionAssertion( FailureHandler.Object, new Exception(string.Empty, inner)).WithInnerException <ArgumentException>(); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never()); Assert.Same(inner, assertion.Target); }
public void DoesNotContainPassTest() { StringAssertion.DoesNotContain("T"); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never()); }
public void ContainsPassTest() { StringAssertion.Contains("t"); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never()); }
public void HasAtMostSizeFailTest() { new StringAssertion(FailureHandler.Object, "ab").HasAtMostSize(1); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.AtLeastOnce()); }
public void IsNotEqualToIgnoringCasePassTest() { StringAssertion.IsNotEqualToIgnoringCase("rey"); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never()); }
public void IsNullOrNotEmptyPassTest() { StringAssertion.IsNotNullOrEmpty(); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never()); }
public void IsNullOrEmptyNullPassTest() { new StringAssertion(FailureHandler.Object, null).IsNullOrEmpty(); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never()); }
public void ContainsPatternFailTest() { StringAssertion.ContainsPattern("[0-9]+"); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once()); }
public void IsLesserThanOrEqualFailTest() { new DoubleAssertion(FailureHandler.Object, 2).IsLesserThanOrEqualTo(0); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once()); }
public void IsLesserThanPassTest() { new DoubleAssertion(FailureHandler.Object, 12).IsLesserThan(13); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never()); }
public void IsGreaterThanOrEqualPassTest() { new DoubleAssertion(FailureHandler.Object, 32).IsGreaterThanOrEqualTo(32); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never()); }
public void DoesNotEndWithIgnoringCasePassTest() { StringAssertion.DoesNotEndWithIgnoringCase("4356f4356r"); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never()); }
public void DoesNotEndWithIgnoringCaseFailTest() { StringAssertion.DoesNotEndWithIgnoringCase("J"); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once()); }
public void StartsWithPassTest() { StringAssertion.StartsWith("t"); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never()); }
public void IsNullOrEmptyFailTest() { StringAssertion.IsNullOrEmpty(); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once()); }
public void StartsWithIgnoringCaseFailTest() { StringAssertion.StartsWithIgnoringCase("5ft5fre453f34"); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once()); }
public void IsNullOrNotEmptyNullFailTest() { new StringAssertion(FailureHandler.Object, null).IsNotNullOrEmpty(); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once()); }
public void DoesNotStartWithIgnoringCasePassTest() { StringAssertion.DoesNotStartWithIgnoringCase("f457h905f435nh9mfht5"); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never()); }
public void HasAtMostSizePassTest() { new StringAssertion(FailureHandler.Object, "4534").HasAtMostSize(4); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never()); }
public void EndsWithFailTest() { StringAssertion.EndsWith("J"); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once()); }
public void IsNotEqualToIgnoringCaseFailTest() { StringAssertion.IsNotEqualToIgnoringCase("ThrehteRj"); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once()); }
public void DoesNotEndWithPassTest() { StringAssertion.DoesNotEndWith("J"); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never()); }
public void ContainsFailTest() { StringAssertion.Contains("T"); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once()); }
public void EndsWithIgnoringCasePassTest() { StringAssertion.EndsWithIgnoringCase("J"); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never()); }
public void DoesNotContainFailTest() { StringAssertion.DoesNotContain("t"); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once()); }
public void EndsWithIgnoringCaseFailTest() { StringAssertion.EndsWithIgnoringCase("6435f"); FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once()); }