Ejemplo n.º 1
0
        public void WhenArgumentsMatches_should_return_self()
        {
            var builtRule = A.Fake <BuildableCallRule>();

            var config = new FakeConfiguration(this.fake, builtRule);

            Assert.That(config.WhenArgumentsMatch(x => true), Is.SameAs(config));
        }
Ejemplo n.º 2
0
        public void WhenArgumentsMatches_from_VB_should_be_null_guarded()
        {
            var builtRule = A.Fake <BuildableCallRule>();

            var config = new FakeConfiguration(this.fake, builtRule) as FakeItEasy.VisualBasic.IVisualBasicConfigurationWithArgumentValidation;

            NullGuardedConstraint.Assert(() =>
                                         config.WhenArgumentsMatch(x => true));
        }
Ejemplo n.º 3
0
        public void WhenArgumentsMatches_should_be_null_guarded()
        {
            var builtRule = A.Fake <BuildableCallRule>();

            var config = new FakeConfiguration(this.fake, builtRule);

            NullGuardedConstraint.Assert(() =>
                                         config.WhenArgumentsMatch(x => true));
        }
Ejemplo n.º 4
0
        public void WhenArgumentsMatches_from_VB_should_return_configuration_object()
        {
            var builtRule = A.Fake <BuildableCallRule>();

            var config = new FakeConfiguration(this.fake, builtRule) as FakeItEasy.VisualBasic.IVisualBasicConfigurationWithArgumentValidation;

            var returned = config.WhenArgumentsMatch(x => true);

            Assert.That(returned, Is.SameAs(config));
        }
Ejemplo n.º 5
0
        public void WhenArgumentsMatches_from_VB_should_set_predicate_to_built_rule()
        {
            var builtRule = A.Fake <BuildableCallRule>();

            var config = new FakeConfiguration(this.fake, builtRule) as FakeItEasy.VisualBasic.IVisualBasicConfigurationWithArgumentValidation;

            Func <ArgumentCollection, bool> predicate = x => true;

            config.WhenArgumentsMatch(predicate);

            Fake.Assert(builtRule)
            .WasCalled(x => x.UsePredicateToValidateArguments(predicate));
        }
Ejemplo n.º 6
0
        public void WhenArgumentsMatches_should_call_UsePredicateToValidateArguments_on_built_rule()
        {
            Func <ArgumentCollection, bool> predicate = x => true;

            var builtRule = A.Fake <BuildableCallRule>();

            var config = new FakeConfiguration(this.fake, builtRule);

            config.WhenArgumentsMatch(predicate);

            Fake.Assert(builtRule)
            .WasCalled(x => x.UsePredicateToValidateArguments(predicate));
        }