Last active
April 25, 2016 23:21
-
-
Save blairconrad/1570c29c831cab9c598926b25c7f171e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public delegate bool TrySomething(string key, out string result); | |
[Test] | |
public void Should_be_able_to_assign_out_and_ref() | |
{ | |
var fake = A.Fake<TrySomething>(); | |
string sample = null; | |
string expectedOut = "hello"; | |
string result = null; | |
A.CallTo(() => fake.Invoke("key", out sample)).WithAnyArguments().Returns(true).AssignsOutAndRefParameters(expectedOut); | |
fake.Invoke("key", out result); | |
Assert.That(result, Is.SameAs(expectedOut)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment