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);
        }
Esempio n. 6
0
 public void DoesNotContainPassTest()
 {
     StringAssertion.DoesNotContain("T");
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never());
 }
Esempio n. 7
0
 public void ContainsPassTest()
 {
     StringAssertion.Contains("t");
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never());
 }
Esempio n. 8
0
 public void HasAtMostSizeFailTest()
 {
     new StringAssertion(FailureHandler.Object, "ab").HasAtMostSize(1);
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.AtLeastOnce());
 }
Esempio n. 9
0
 public void IsNotEqualToIgnoringCasePassTest()
 {
     StringAssertion.IsNotEqualToIgnoringCase("rey");
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never());
 }
Esempio n. 10
0
 public void IsNullOrNotEmptyPassTest()
 {
     StringAssertion.IsNotNullOrEmpty();
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never());
 }
Esempio n. 11
0
 public void IsNullOrEmptyNullPassTest()
 {
     new StringAssertion(FailureHandler.Object, null).IsNullOrEmpty();
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never());
 }
Esempio n. 12
0
 public void ContainsPatternFailTest()
 {
     StringAssertion.ContainsPattern("[0-9]+");
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once());
 }
Esempio n. 13
0
 public void IsLesserThanOrEqualFailTest()
 {
     new DoubleAssertion(FailureHandler.Object, 2).IsLesserThanOrEqualTo(0);
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once());
 }
Esempio n. 14
0
 public void IsLesserThanPassTest()
 {
     new DoubleAssertion(FailureHandler.Object, 12).IsLesserThan(13);
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never());
 }
Esempio n. 15
0
 public void IsGreaterThanOrEqualPassTest()
 {
     new DoubleAssertion(FailureHandler.Object, 32).IsGreaterThanOrEqualTo(32);
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never());
 }
Esempio n. 16
0
 public void DoesNotEndWithIgnoringCasePassTest()
 {
     StringAssertion.DoesNotEndWithIgnoringCase("4356f4356r");
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never());
 }
Esempio n. 17
0
 public void DoesNotEndWithIgnoringCaseFailTest()
 {
     StringAssertion.DoesNotEndWithIgnoringCase("J");
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once());
 }
Esempio n. 18
0
 public void StartsWithPassTest()
 {
     StringAssertion.StartsWith("t");
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never());
 }
Esempio n. 19
0
 public void IsNullOrEmptyFailTest()
 {
     StringAssertion.IsNullOrEmpty();
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once());
 }
Esempio n. 20
0
 public void StartsWithIgnoringCaseFailTest()
 {
     StringAssertion.StartsWithIgnoringCase("5ft5fre453f34");
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once());
 }
Esempio n. 21
0
 public void IsNullOrNotEmptyNullFailTest()
 {
     new StringAssertion(FailureHandler.Object, null).IsNotNullOrEmpty();
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once());
 }
Esempio n. 22
0
 public void DoesNotStartWithIgnoringCasePassTest()
 {
     StringAssertion.DoesNotStartWithIgnoringCase("f457h905f435nh9mfht5");
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never());
 }
Esempio n. 23
0
 public void HasAtMostSizePassTest()
 {
     new StringAssertion(FailureHandler.Object, "4534").HasAtMostSize(4);
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never());
 }
Esempio n. 24
0
 public void EndsWithFailTest()
 {
     StringAssertion.EndsWith("J");
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once());
 }
Esempio n. 25
0
 public void IsNotEqualToIgnoringCaseFailTest()
 {
     StringAssertion.IsNotEqualToIgnoringCase("ThrehteRj");
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once());
 }
Esempio n. 26
0
 public void DoesNotEndWithPassTest()
 {
     StringAssertion.DoesNotEndWith("J");
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never());
 }
Esempio n. 27
0
 public void ContainsFailTest()
 {
     StringAssertion.Contains("T");
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once());
 }
Esempio n. 28
0
 public void EndsWithIgnoringCasePassTest()
 {
     StringAssertion.EndsWithIgnoringCase("J");
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Never());
 }
Esempio n. 29
0
 public void DoesNotContainFailTest()
 {
     StringAssertion.DoesNotContain("t");
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once());
 }
Esempio n. 30
0
 public void EndsWithIgnoringCaseFailTest()
 {
     StringAssertion.EndsWithIgnoringCase("6435f");
     FailureHandler.Verify(x => x.Fail(It.IsAny <string>()), Times.Once());
 }