From 8eb2999330f0765e7775153ce7c9ef5641f254a9 Mon Sep 17 00:00:00 2001 From: stakx <stakx@eml.cc> Date: Thu, 18 Jun 2020 21:38:41 +0200 Subject: [PATCH] Another failing `DefaultValue.Mock` / `Verify` test --- .../Regressions/IssueReportsFixture.cs | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/Moq.Tests/Regressions/IssueReportsFixture.cs b/tests/Moq.Tests/Regressions/IssueReportsFixture.cs index 57aa4c4e4..3aea9ab14 100644 --- a/tests/Moq.Tests/Regressions/IssueReportsFixture.cs +++ b/tests/Moq.Tests/Regressions/IssueReportsFixture.cs @@ -3328,9 +3328,29 @@ public void Verify_passes_when_DefaultValue_Mock_and_setup_without_any_Returns() totoMock.Verify(); } + [Fact] + public void Verify_passes_when_DefaultValue_Mock_and_setup_with_Returns() + { + var totoMock = new Mock<IToto>(); + var tataMock = new Mock<ITata>() { DefaultValue = DefaultValue.Mock }; + + totoMock.Setup(o => o.DoToto()).Returns(tataMock.Object).Verifiable(); + + totoMock.Object.DoToto(); + tataMock.Object.DoTata(); + + totoMock.Verify(); + } + public interface IToto { IList<string> Do(); + ITata DoToto(); + } + + public interface ITata + { + IList<string> DoTata(); } } #endregion