Fix FastFetch test failure#186
Conversation
| if (!expectError) | ||
| { | ||
| result.Errors.ShouldBeEmpty(result.Errors); | ||
| result.ExitCode.ShouldEqual(0); |
There was a problem hiding this comment.
If expectError is true can\should we verify that ExitCode is non-zero?
33fc478 to
9087f85
Compare
| result.Output.Contains("Error").ShouldEqual(expectError, result.Output); | ||
| if (expectError) | ||
| { | ||
| Assert.IsTrue(result.Errors.Length > 0); |
There was a problem hiding this comment.
In our tests we try to use the Should syntax whenever possible. Rather than doing:
Assert.IsTrue(result.Errors.Length > 0);
Switch to something like one of these:
result.Errors.Length.ShouldBeNonEmpty("Expected an error message");
result.Errors.Length.ShouldBeAtLeast(1, "Expected an error message");
There was a problem hiding this comment.
What would Should be non empty mean for an integer?
There was a problem hiding this comment.
Doh, that option should have been result.Errors.ShouldBeNonEmpty("Expected an error message");
| result.Output.Contains("Error").ShouldEqual(expectError, result.Output); | ||
| if (expectError) | ||
| { | ||
| result.Errors.Length.ShouldBeAtLeast(1, "Expected at lest 1 error"); |
|
@kyle-rader I'm approving but please make sure full functional tests pass before merging |
58adfb5 to
0422c3b
Compare
|
|
||
| string[] expectedResults = new string[] { "Cannot use --force-checkout option without --checkout option." }; | ||
| result.ShouldContain(expectedResults); | ||
| // Run a second time in the same repo on the same branch with more folders but expect an error. |
There was a problem hiding this comment.
@kyle-rader, could you update this comment to explain why we're expecting an error?
(I'm not sure why the check you removed was failing)
c151bd4 to
e514b3b
Compare
This should fix the somehow missed test failure for FastFetch addressing #185