Skip to content

Commit

Permalink
Add test Property_stubbed_by_SetupAllProperties_should_use_parent_Def…
Browse files Browse the repository at this point in the history
…aultValue_behaviour_for_inner_mocks
  • Loading branch information
ishimko committed Jun 1, 2019
1 parent b2c4759 commit d2e8911
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/Moq.Tests/StubExtensionsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,16 @@ public void Property_stubbed_by_SetupAllProperties_should_capture_DefaultValue_b

Assert.NotNull(mock.Object.Hierarchy.Hierarchy);
}

[Fact]
public void Property_stubbed_by_SetupAllProperties_should_use_parent_DefaultValue_behaviour_for_inner_mocks()
{
var mock = new Mock<IHierarchy>() { DefaultValue = DefaultValue.Mock };
mock.SetupAllProperties();
Mock.Get(mock.Object.Hierarchy).DefaultValue = DefaultValue.Empty;

Assert.NotNull(mock.Object.Hierarchy.Hierarchy);
}

public abstract class WriteOnlyProperty
{
Expand Down

0 comments on commit d2e8911

Please sign in to comment.