Exemple #1
0
        public void Matches_WhenFirstValueIsNotContext_ReturnsFalse(ContextControlStringMatcher unit)
        {
            unit.Context = "foo";

            var fixture = new Fixture();

            fixture.Customizations.Add(new InlineConstructorParams <ControlString>(0, 3, new Queue <string>(new[] { "bar" })));

            var controlString = fixture.Create <ControlString>();

            unit.Matches(controlString).ShouldBeFalse();
        }
Exemple #2
0
        public void Matches_WhenFirstValueIsContextAndSubMatcherDoesNotMatch_ReturnsFalse([Frozen] IControlStringMatcher submatcher, ContextControlStringMatcher unit)
        {
            Mock.Get(submatcher).Setup(x => x.Matches(It.IsAny <ControlString>())).Returns(false);

            unit.Context = "foo";

            var fixture = new Fixture();

            fixture.Customizations.Add(new InlineConstructorParams <ControlString>(0, 3, new Queue <string>(new[] { unit.Context })));

            var controlString = fixture.Create <ControlString>();

            unit.Matches(controlString).ShouldBeFalse();
        }
Exemple #3
0
 public void Matches_WhenControlStringIsNull_ThrowsArgumentNullException(ContextControlStringMatcher unit)
 {
     Should.Throw <ArgumentNullException>(() => unit.Matches(null));
 }