Skip to content

Commit 8eb2999

Browse files
committed
Another failing DefaultValue.Mock / Verify test
1 parent a20d1df commit 8eb2999

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/Moq.Tests/Regressions/IssueReportsFixture.cs

+20
Original file line numberDiff line numberDiff line change
@@ -3328,9 +3328,29 @@ public void Verify_passes_when_DefaultValue_Mock_and_setup_without_any_Returns()
33283328
totoMock.Verify();
33293329
}
33303330

3331+
[Fact]
3332+
public void Verify_passes_when_DefaultValue_Mock_and_setup_with_Returns()
3333+
{
3334+
var totoMock = new Mock<IToto>();
3335+
var tataMock = new Mock<ITata>() { DefaultValue = DefaultValue.Mock };
3336+
3337+
totoMock.Setup(o => o.DoToto()).Returns(tataMock.Object).Verifiable();
3338+
3339+
totoMock.Object.DoToto();
3340+
tataMock.Object.DoTata();
3341+
3342+
totoMock.Verify();
3343+
}
3344+
33313345
public interface IToto
33323346
{
33333347
IList<string> Do();
3348+
ITata DoToto();
3349+
}
3350+
3351+
public interface ITata
3352+
{
3353+
IList<string> DoTata();
33343354
}
33353355
}
33363356
#endregion

0 commit comments

Comments
 (0)