public void LocalizerCode_should_be_expected_value() { var subj = new AndMatcher <string>(Matchers.BeEmpty(), Matchers.HaveCount(0)); var failure = TestMatcherLocalizer.Failure(subj, ""); Assert.Equal("spec.and", failure.Name.ToString()); }
public void CalculatesLogicalConjunctionOfTwoMatchers() { for (int i = 0; i < truthTable.GetLength(0); i++) { Matcher matcher = new AndMatcher((Matcher)truthTable[i, 0], (Matcher)truthTable[i, 1]); Assert.AreEqual(truthTable[i, 2], matcher.Matches(ignored)); } }
public void LocalizerFailure_should_generate_negated_children() { var subj = new AndMatcher <string>(Matchers.BeEmpty(), Matchers.HaveCount(0)); var failure = TestMatcherLocalizer.Failure(Matchers.Not(subj), ""); var exception = failure.ToException(); var label = exception.Message.Split('\n').Select(t => t.Trim()).First(); Assert.Equal("Not expected to:", label); }
public void LocalizerFailure_should_generate_children() { var subj = new AndMatcher <string>(Matchers.BeEmpty(), Matchers.HaveCount(0)); var failure = TestMatcherLocalizer.Failure(subj, ""); var exception = failure.ToException(); var lines = exception.Message.Split('\n').Select(t => t.Trim()).Take(3); var expected = new [] { "Expected to:", "- be empty", "- and have count 0", }; Assert.Equal(expected, lines); }
public void Matches_should_detect_nominal() { var subj = new AndMatcher <string>(Matchers.BeEmpty(), Matchers.HaveCount(0)); Assert.True(subj.Matches(TestActual.Value(""))); }