ameniameni / moq

Automatically exported from code.google.com/p/moq
Other
0 stars 0 forks source link

Fluent mock does not honor parent mock CallBase setting. #200

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago

[Fact]
public void NewMocksHaveSameCallBaseAsOwner()
{
    var mock = new Mock<IFoo>();
    var provider = new MockDefaultValueProvider(mock);

    var value =
provider.ProvideDefault(typeof(IFoo).GetProperty("Bar").GetGetMethod(), new
object[0]);

    var barMock = Mock.Get((IBar)value);

    Assert.Equal(mock.CallBase, barMock.CallBase);
}

Original issue reported on code.google.com by kzu.net on 10 Aug 2009 at 2:11

GoogleCodeExporter commented 8 years ago
Should have been:

var mock = new Mock<IFoo> { CallBase = true };

Original comment by kzu.net on 10 Aug 2009 at 2:12

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r614.

Original comment by kzu.net on 10 Aug 2009 at 2:13