Last active
December 16, 2015 09:19
-
-
Save DavidSSL/5411894 to your computer and use it in GitHub Desktop.
Correct implementation of Parser Test
This file contains 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
[Theory, AutoFixture] | |
public void ParseValidInputShouldReturnCorrectResult( | |
PatientReportParser sut) | |
{ | |
const string argsString = @"-o=C:\Temp\someFile -p=1 -d"; | |
var args = new string[0]; | |
IResult actualResult = null; | |
var expectedResult = | |
new Likeness<CreateReportResult, CreateReportResult>(new CreateReportResult(@"C:\Temp\someFile", "1", "database")); | |
"Given valid arguments" | |
.Given(() => args = argsString.Split(' ')); | |
"When Parse is called" | |
.When(() => actualResult = (CreateReportResult) sut.Parse(args)); | |
"Then the correct IResult should be returned" | |
.Then(() => actualResult.Should().BeOfType<CreateReportResult>()); | |
"And the CreateReportResult should be correctly initialised" | |
.And(() => Assert.True(expectedResult.Equals(actualResult), "The CreateReport object's properties should have been initialised correctly")); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment