public void Matches_should_detect_contra_nominal() { var subj = Matchers.Or(Matchers.BeEmpty(), Matchers.HaveCount(0)); Assert.False(subj.Matches(TestActual.Value(new List <string> { "A", "B" }))); }
public void Matches_should_detect_error() { var subj = new NotMatcher <int>( Matchers.Equal(20) ); var val = subj.Matches(TestActual.Value(20)); Assert.False(val); }
public void Matches_should_apply_nominal() { var subj = new NotMatcher <int>( Matchers.Equal(20) ); var val = subj.Matches(TestActual.Value(10)); Assert.True(val); }
public void Matches_should_detect_empty_nominal_func() { var subj = new SatisfyAnyMatcher <int[]>( Matchers.BeEmpty(), Matchers.HaveCount(10) ); var val = subj.Matches(TestActual.Value(new int[] { 2 })); Assert.False(val); }
public void Matches_should_apply_Any_nominal() { var subj = new SatisfyAnyMatcher <int[]>( Matchers.BeEmpty(), Matchers.HaveCount(10) ); var val = subj.Matches(TestActual.Value(new int[0])); Assert.True(val); }
public void Matches_should_fail_on_null_thunk() { var subj = new InstanceOfMatcher(typeof(string)); try { subj.Matches(TestActual.Value((string)null)); Assert.Fail("Expected to fail with AssertException -- can't match null"); } catch (AssertVerificationException) { Assert.Pass(); } }
public void Matches_should_detect_nominal() { var subj = new OrMatcher <string>(Matchers.BeEmpty(), Matchers.HaveCount(0)); Assert.True(subj.Matches(TestActual.Value(""))); }