diff --git a/docs/explicit-targets.md b/docs/explicit-targets.md index 2085885c4..66f51d3df 100644 --- a/docs/explicit-targets.md +++ b/docs/explicit-targets.md @@ -100,7 +100,7 @@ public Task WithTargets() => name: "targetName") ]); ``` -snippet source | anchor +snippet source | anchor diff --git a/docs/naming.md b/docs/naming.md index 370bc06e3..694a24c6a 100644 --- a/docs/naming.md +++ b/docs/naming.md @@ -623,7 +623,7 @@ Verifier.DerivePathInfo( typeName: type.Name, methodName: method.Name)); ``` -snippet source | anchor +snippet source | anchor diff --git a/src/Verify.MSTest.Tests/Tests.VerifyFileWithFullPath.verified.png b/src/Verify.MSTest.Tests/Tests.VerifyFileWithFullPath.verified.png new file mode 100644 index 000000000..b54820aa6 Binary files /dev/null and b/src/Verify.MSTest.Tests/Tests.VerifyFileWithFullPath.verified.png differ diff --git a/src/Verify.MSTest.Tests/Tests.VerifyFileWithRelativePath.verified.png b/src/Verify.MSTest.Tests/Tests.VerifyFileWithRelativePath.verified.png new file mode 100644 index 000000000..b54820aa6 Binary files /dev/null and b/src/Verify.MSTest.Tests/Tests.VerifyFileWithRelativePath.verified.png differ diff --git a/src/Verify.MSTest.Tests/Tests.cs b/src/Verify.MSTest.Tests/Tests.cs index 611e77540..b0482abd8 100644 --- a/src/Verify.MSTest.Tests/Tests.cs +++ b/src/Verify.MSTest.Tests/Tests.cs @@ -176,4 +176,23 @@ public Task WithZip() => VerifyZip(zipPath); #endregion + + [TestMethod] + public Task VerifyFileWithRelativePath() => + VerifyFile("sample.png"); + + [TestMethod] + public Task VerifyFileWithFullPath() + { + var fullPath = Path.GetFullPath("sample.png"); + return VerifyFile(fullPath); + } + + [TestMethod] + public Task VerifyFileWithFullPathAndUseFileName() + { + var fullPath = Path.GetFullPath("sample.png"); + return VerifyFile(fullPath) + .UseFileName("customFileName"); + } } \ No newline at end of file diff --git a/src/Verify.MSTest.Tests/Verify.MSTest.Tests.csproj b/src/Verify.MSTest.Tests/Verify.MSTest.Tests.csproj index 8e70cd097..93f642f45 100644 --- a/src/Verify.MSTest.Tests/Verify.MSTest.Tests.csproj +++ b/src/Verify.MSTest.Tests/Verify.MSTest.Tests.csproj @@ -11,6 +11,7 @@ + @@ -22,6 +23,12 @@ + + + PreserveNewest + + + diff --git a/src/Verify.MSTest.Tests/customFileName.verified.png b/src/Verify.MSTest.Tests/customFileName.verified.png new file mode 100644 index 000000000..b54820aa6 Binary files /dev/null and b/src/Verify.MSTest.Tests/customFileName.verified.png differ diff --git a/src/Verify.MSTest.Tests/sample.png b/src/Verify.MSTest.Tests/sample.png new file mode 100644 index 000000000..b54820aa6 Binary files /dev/null and b/src/Verify.MSTest.Tests/sample.png differ