Beispiel #1
0
        public void OnHasAnyWhichIsNull_WithNull_ShouldReturnFailure()
        {
            HasAnyAssertion <string> assertion = HasAnyAssertion(s => s.IsNull());
            ValueAssertionResult     result    = assertion.AssertValue(null);

            Assert.IsFalse(result.succeeded);
            Assert.AreEqual("null", result.actualValueString);
            Assert.AreEqual(ComposeLog.Expected("at least 1 match"),
                            result.expectationString);
        }
Beispiel #2
0
        public void OnHasAnyWhichIsNull_WhitArrayHavingStringy_ShouldFail()
        {
            HasAnyAssertion <string> assertion = HasAnyAssertion(s => s.IsNull());
            ValueAssertionResult     result    = assertion.AssertValue(new[] { "Stringy" });

            Assert.IsFalse(result.succeeded);
            Assert.AreEqual("<0 matches>".NewLine()
                            .Add("'Stringy'"),
                            result.actualValueString);
            Assert.AreEqual(ComposeLog.Expected("at least 1 match").NewLine()
                            .Add(ComposeLog.Expected("null")),
                            result.expectationString);
        }
Beispiel #3
0
        public void OnHasAnyWhichIsNull_WithArrayHavingNull_ShouldReturnSuccess()
        {
            HasAnyAssertion <string> assertion = HasAnyAssertion(s => s.IsNull());
            ValueAssertionResult     result    = assertion.AssertValue(new string[] { null });

            Assert.IsTrue(result.succeeded);
            Assert.AreEqual("<1 match>".NewLine()
                            .Add("null"),
                            result.actualValueString);
            Assert.AreEqual(ComposeLog.Expected("at least 1 match").NewLine()
                            .Add(ComposeLog.Expected("null")),
                            result.expectationString);
        }