Skip to content

Commit

Permalink
Inner mock setup causes verification failure
Browse files Browse the repository at this point in the history
  • Loading branch information
stakx committed Oct 14, 2020
1 parent ab83afc commit 42c0083
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/Moq.Tests/Regressions/IssueReportsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3488,6 +3488,30 @@ public void Property_set_up_with_Mock_Of_is_automatically_stubbed__manual_inner_

#endregion

#region 1073

public class Issue1073
{
[Fact]
public void Test()
{
var mock = new Mock<IClassA>();
mock.Setup(x => x.Items.Count).Returns(1); // not verifiable, but won't be invoked
mock.Setup(x => x.Method()).Verifiable(); // verifiable, and will be invoked

mock.Object.Method();

mock.Verify();
}
public interface IClassA
{
public IList<string> Items { get; set; }
public void Method();
}
}

#endregion

// Old @ Google Code

#region #47
Expand Down

0 comments on commit 42c0083

Please sign in to comment.