-
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addition changes to enable Verify.Cli app (#888)
- Add simple constructor to InnerVerifier for just comparing files - Ensure replacements field is valid even if we haven't called UseAssembly
- Loading branch information
Showing
6 changed files
with
120 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
public class InnerVerifyTests | ||
{ | ||
[Fact] | ||
public void InnerVerifier_FileConstructor() | ||
{ | ||
const string sourceFile = "path/to/source/file.cs"; | ||
var settings = new VerifySettings(); | ||
|
||
var verifier = new InnerVerifier(sourceFile, settings); | ||
|
||
Assert.NotNull(verifier); | ||
} | ||
|
||
[Fact] | ||
|
||
#region VerifyFileWithoutUnitTest | ||
|
||
public async Task VerifyExternalFile() | ||
{ | ||
var solutionDirectory = AttributeReader.GetSolutionDirectory(); | ||
var settings = new VerifySettings(); | ||
settings.DisableRequireUniquePrefix(); | ||
|
||
var sourceFile = Path.Combine(solutionDirectory, "Verify.Tests", "sample.txt"); | ||
|
||
Func<InnerVerifier, Task<VerifyResult>> verify = _ => _.VerifyFile(sourceFile, null); | ||
await new SettingsTask( | ||
settings, | ||
async verifySettings => | ||
{ | ||
using var verifier = new InnerVerifier( | ||
sourceFile, | ||
verifySettings | ||
); | ||
return await verify(verifier); | ||
}); | ||
} | ||
|
||
#endregion | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Foo |
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
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