Skip to content

Instantly share code, notes, and snippets.

@ploeh
Created August 22, 2011 13:40
Show Gist options
  • Save ploeh/1162395 to your computer and use it in GitHub Desktop.
Save ploeh/1162395 to your computer and use it in GitHub Desktop.
Inline auto-data
[Theory]
[InlineAutoHostData(null)]
[InlineAutoHostData("")]
[InlineAutoHostData]
public void ExecuteUnknownInputCorrectlyInvokesOnUnknown(string unknownInput, Action dummyOnExit)
{
var verified = false;
var sut = new InputParseCommand(dummyOnExit, i => verified = i == unknownInput);
sut.Execute(unknownInput);
Assert.True(verified);
}
@ploeh
Copy link
Author

ploeh commented Aug 22, 2011

Notice the heterogeneous shape of the inline test data, as well as the disconnect between supplied and required values.

AutoFixture takes care of the rest :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment