Skip to content

Instantly share code, notes, and snippets.

@babaktaremi
Last active June 13, 2021 11:10
Show Gist options
  • Save babaktaremi/3f82e1adad045defcc16200d14fb2d49 to your computer and use it in GitHub Desktop.
Save babaktaremi/3f82e1adad045defcc16200d14fb2d49 to your computer and use it in GitHub Desktop.
[Test]
public void OutAndRefTest()
{
var mock = new Mock<IFoo>();
var requiredOutput = "ok";
mock.Setup(foo => foo.TryParse("ping", out requiredOutput)).Returns(true);
string result;
Assert.Multiple(() =>
{
Assert.IsTrue(mock.Object.TryParse("ping",out result));
Assert.That(result,Is.EqualTo(requiredOutput));
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment