Beispiel #1
0
        public void Apply_should_create_asserter_and_call_it_with_the_recorded_call_when_IsAssertion_is_set_to_true_on_recorded_rule()
        {
            this.recordedRule.IsAssertion = true;

            var rule = this.CreateRule();

            var call = A.Fake <IWritableFakeObjectCall>();

            Fake.Configure(call)
            .CallsTo(x => x.ToString())
            .Returns("call description");

            rule.Apply(call);

            Fake.Assert(this.asserter)
            .WasCalled(x => x.AssertWasCalled(Its.Any <Func <IFakeObjectCall, bool> >(), "call description", Its.Any <Func <int, bool> >(), "the number of times specified by predicate"));
        }
Beispiel #2
0
 private void StubMethodInfoManagerToReturn(bool returnValue)
 {
     Fake.Configure(this.methodInfoManager)
     .CallsTo(x => x.WillInvokeSameMethodOnTarget(Its.Any <Type>(), Its.Any <MethodInfo>(), Its.Any <MethodInfo>()))
     .Returns(returnValue);
 }