-
Notifications
You must be signed in to change notification settings - Fork 451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Repair Functional Tests: test for confirm on and off #335
Conversation
|
||
this.Enlistment.TryMountGVFS().ShouldEqual(false, "Repair without confirm should not fix the enlistment"); | ||
|
||
this.Enlistment.Repair(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Helper method for these three lines?
@@ -23,7 +33,11 @@ public void FixesCorruptHeadSha() | |||
|
|||
this.Enlistment.TryMountGVFS().ShouldEqual(false, "GVFS shouldn't mount when HEAD is corrupt"); | |||
|
|||
this.Enlistment.Repair(); | |||
this.Enlistment.Repair(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually use named parameters for constant values like
this.Enlistment.Repair(confirm: false);
"repair --confirm \"" + this.enlistmentRoot + "\"", | ||
failOnError: true); | ||
string confirmArg = confirm == true ? "--confirm " : string.Empty; | ||
if (confirm) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you should be checking this bool otherwise the repair will not be ran when false
. We still want to run it just without the --confirm
this.CallGVFS( | ||
"repair --confirm \"" + this.enlistmentRoot + "\"", | ||
failOnError: true); | ||
string confirmArg = confirm == true ? "--confirm " : string.Empty; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need the == true
here.
GVFS/GVFS.FunctionalTests/Tests/EnlistmentPerTestCase/RepairTests.cs
Outdated
Show resolved
Hide resolved
public void NoFixesNeeded() | ||
{ | ||
this.Enlistment.UnmountGVFS(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another style nit: I think there are an excessive number of blank lines in these tests. It's hard to read code when each line of code is followed by a blank line :-)
45c106f
to
f00be38
Compare
f00be38
to
b627ceb
Compare
Enrich existing tests to include confirm off
b627ceb
to
46f9bc5
Compare
Enrich existing tests to include confirm off
Per @kewillford 's request. This change should run quickly and give us added security.