-
-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f9b48ce
commit 502105a
Showing
8 changed files
with
103 additions
and
5 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,27 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>net6</TargetFramework> | ||
<GenerateAssemblyInfo>true</GenerateAssemblyInfo> | ||
<IsPackageProject>false</IsPackageProject> | ||
<DisableImplicitNamespaceImports>true</DisableImplicitNamespaceImports> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" /> | ||
<PackageReference Include="Xunit" Version="2.4.1" /> | ||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5" PrivateAssets="all" /> | ||
<PackageReference Include="ProjectDefaults" Version="1.0.78" PrivateAssets="all" /> | ||
<ProjectReference Include="..\Verify.Xunit\Verify.Xunit.csproj" /> | ||
<ProjectReference Include="..\Verify\Verify.csproj" /> | ||
</ItemGroup> | ||
<Import Project="$(ProjectDir)..\Verify\buildTransitive\Verify.props" /> | ||
<Import Project="$(ProjectDir)..\Verify\buildTransitive\Verify.targets" /> | ||
<Import Project="$(ProjectDir)..\Verify.Xunit\buildTransitive\Verify.Xunit.props" /> | ||
<!--Work around: https://github.com/dotnet/sdk/issues/21006--> | ||
<Target Name="DisableAnalyzers" BeforeTargets="CoreCompile"> | ||
<ItemGroup> | ||
<Analyzer Remove="@(Analyzer)" /> | ||
</ItemGroup> | ||
</Target> | ||
</Project> |
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,23 @@ | ||
[UsesVerify] | ||
public class Tests | ||
{ | ||
static Tests() | ||
{ | ||
#region StaticAutoVerify | ||
|
||
VerifierSettings.AutoVerify(); | ||
|
||
#endregion | ||
} | ||
|
||
|
||
[Fact] | ||
public async Task Simple() | ||
{ | ||
var path = Path.Combine(AttributeReader.GetProjectDirectory(), "Tests.Simple.verified.txt"); | ||
var fullPath = Path.GetFullPath(path); | ||
File.Delete(fullPath); | ||
await Verify("Foo"); | ||
File.Delete(fullPath); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,9 +1,31 @@ | ||
namespace VerifyTests; | ||
using DiffEngine; | ||
|
||
namespace VerifyTests; | ||
|
||
public static partial class VerifierSettings | ||
{ | ||
internal static bool omitContentFromException; | ||
|
||
public static void OmitContentFromException() => | ||
omitContentFromException = true; | ||
|
||
/// <summary> | ||
/// Automatically accept the results of all tests. | ||
/// </summary> | ||
public static void AutoVerify(bool includeBuildServer = true) | ||
{ | ||
if (includeBuildServer) | ||
{ | ||
autoVerify = true; | ||
} | ||
else | ||
{ | ||
if (!BuildServerDetector.Detected) | ||
{ | ||
autoVerify = true; | ||
} | ||
} | ||
} | ||
|
||
internal static bool autoVerify; | ||
} |
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