Skip to content

Commit

Permalink
Another failing DefaultValue.Mock / Verify test
Browse files Browse the repository at this point in the history
  • Loading branch information
stakx committed Jun 18, 2020
1 parent a20d1df commit 8eb2999
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/Moq.Tests/Regressions/IssueReportsFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8eb2999

Please sign in to comment.