public static void InvokesAfterStrictFakeableableReferenceTypeKeepsDefaultReturnValue( IFoo fake, IFoo result) { "Given a strict fake" .x(() => fake = A.Fake <IFoo>(options => options.Strict())); "And I configure all methods to invoke an action" .x(() => A.CallTo(fake).Invokes(() => { })); "When I call a fakeable reference type method" .x(() => result = fake.Bafoo()); "Then it returns the same value as an unconfigured fake" .x(() => result.Should().Be(A.Fake <IFoo>().Bafoo())); }
public static void AssignsOutAndRefParametersForAllMethodsKeepsDefaultReturnValue( IFoo fake, IFoo result, int i) { "Given a fake" .x(() => fake = A.Fake <IFoo>()); "And I configure all methods to assign out and ref parameters" .x(() => A.CallTo(fake).AssignsOutAndRefParameters(0)); "When I call a reference type method" .x(() => result = fake.Bafoo(out i)); "Then it returns the same value as an unconfigured fake" .x(() => result.Should().Be(A.Fake <IFoo>().Bafoo(out i))); }