Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spectre.Verify.Extensions

Continuous Integration NuGet Status

Add an attribute driven file naming convention to Verify.

NuGet package

https://nuget.org/packages/Spectre.Verify.Extensions/

Usage

At startup pass Expectations.Initialize to VerifierSettings.DerivePathInfo:

public static class VerifyConfig
{
    [ModuleInitializer]
    public static void Init()
    {
        Verifier.DerivePathInfo(Expectations.Initialize);
    }
}

snippet source | anchor

Then the following test

[ExpectationPath("Foo")]
public static class ExpectationTests
{
    public static class MyOtherTestClass
    {
        [ExpectationPath("Bar/Qux")]
        public class MyOtherOtherTestClass
        {
            [Fact]
            [Expectation("Waldo")]
            public async Task Test1()
            {
                await Verifier.Verify("w00t");
            }
        }
    }

    [ExpectationPath("Baz")]
    public class YetAnotherTestClass
    {
        [Fact]
        [Expectation("Corgi", "Lol")]
        public async Task Test1()
        {
            await Verifier.Verify("lol");
        }
    }
}

snippet source | anchor

Will produce the following directory structure:

ProjectDir
  - Expectations
    - Foo
      - Bar
        - Qux
          - Waldo.Output.verified.txt
      - Baz
        - Corgi.Lol.verified.txt

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.