Using the following code I expect the call to env.BuildSchema(fakeConn) to be ignored, instead this method is called with a null value?? Even when I configure the fakeDbConfig to return a recursive fake, still the GetConnection call returns a null value and env.BuildSchema does not get ignored.
[Isolated]
private static EnvironmentConfiguration GetEnvironmentConfiguration()
{
var fakeDbConfig = Isolate.Fake.Instance<IDatabaseConfig>();
var fakeConn = Isolate.Fake.Instance<IDbConnection>();
Isolate.WhenCalled(() => fakeDbConfig.GetConnection()).WillReturn(fakeConn);
var fakeConfig = Isolate.Fake.Instance<Configuration>();
var env = new EnvironmentConfiguration(TestEnv, fakeConfig, fakeDbConfig);
Isolate.WhenCalled(() => env.BuildSchema(fakeConn)).WithExactArguments().IgnoreCall();
return env;
}
p.s. Also when I do
Isolate.WhenCalled(() => env.BuildSchema(fakeConn)).IgnoreCall();
the method still gets called, with a null value.