Skip to content

Instantly share code, notes, and snippets.

@hmemcpy
Last active January 1, 2016 23:48
Show Gist options
  • Save hmemcpy/8218569 to your computer and use it in GitHub Desktop.
Save hmemcpy/8218569 to your computer and use it in GitHub Desktop.
AcountProvider provider = AccountProvider.CreateProvider();
AcountProvider outProvider;
A.CallTo(() => mockAppointment.GetAccountCollection().GetProviderImpl(out outProvider)) // GetProviderImpl is a generic method
.Returns(true)
.AssignsOutAndRefParameters(provider);
bool result = mockAppointment.GetAccountCollection().GetProviderImp(out outProvider); // this returns false and provider is null???
@adamralph
Copy link

No probs.

I remember the details now. This is actually by design. Unconfigured fake methods return a new instance each time and unconfigured fake properties return the same instance each time. Excruciating detail can be found in this conversation FakeItEasy/FakeItEasy#156

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment