Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Mar 11, 2024
1 parent 0c78d77 commit 0fbbaa7
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 8 deletions.
11 changes: 10 additions & 1 deletion docs/mdsource/verify-options.source.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,18 @@ In some scenarios it makes sense to auto-accept any changes as part of a given t

This can be done using `AutoVerify()`:


### Instance

snippet: AutoVerify

Or globally

### Fluent

snippet: AutoVerifyFluent


### Globally

snippet: StaticAutoVerify

Expand Down
8 changes: 4 additions & 4 deletions docs/serializer-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ Extra Json.NET settings can be made:
VerifierSettings.AddExtraSettings(
_ => _.TypeNameHandling = TypeNameHandling.All);
```
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L128-L133' title='Snippet source file'>snippet source</a> | <a href='#snippet-extrasettingsglobal' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L136-L141' title='Snippet source file'>snippet source</a> | <a href='#snippet-extrasettingsglobal' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -237,7 +237,7 @@ var settings = new VerifySettings();
settings.AddExtraSettings(
_ => _.TypeNameHandling = TypeNameHandling.All);
```
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L135-L141' title='Snippet source file'>snippet source</a> | <a href='#snippet-extrasettingsinstance' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L143-L149' title='Snippet source file'>snippet source</a> | <a href='#snippet-extrasettingsinstance' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -255,7 +255,7 @@ class CompanyConverter :
writer.WriteMember(company, company.Name, "Name");
}
```
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L155-L164' title='Snippet source file'>snippet source</a> | <a href='#snippet-companyconverter' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L163-L172' title='Snippet source file'>snippet source</a> | <a href='#snippet-companyconverter' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

<!-- snippet: JsonConverter -->
Expand All @@ -264,7 +264,7 @@ class CompanyConverter :
VerifierSettings.AddExtraSettings(
_ => _.Converters.Add(new CompanyConverter()));
```
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L147-L152' title='Snippet source file'>snippet source</a> | <a href='#snippet-jsonconverter' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L155-L160' title='Snippet source file'>snippet source</a> | <a href='#snippet-jsonconverter' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
22 changes: 20 additions & 2 deletions docs/verify-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ In some scenarios it makes sense to auto-accept any changes as part of a given t

This can be done using `AutoVerify()`:


### Instance

<!-- snippet: AutoVerify -->
<a id='snippet-autoverify'></a>
```cs
Expand All @@ -25,7 +28,22 @@ settings.AutoVerify();
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L106-L111' title='Snippet source file'>snippet source</a> | <a href='#snippet-autoverify' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Or globally

### Fluent

<!-- snippet: AutoVerifyFluent -->
<a id='snippet-autoverifyfluent'></a>
```cs
[Fact]
public Task AutoVerifyFluent() =>
Verify("Value")
.AutoVerify();
```
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L113-L120' title='Snippet source file'>snippet source</a> | <a href='#snippet-autoverifyfluent' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


### Globally

<!-- snippet: StaticAutoVerify -->
<a id='snippet-staticautoverify'></a>
Expand Down Expand Up @@ -93,5 +111,5 @@ To disable diff launching:
var settings = new VerifySettings();
settings.DisableDiff();
```
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L117-L122' title='Snippet source file'>snippet source</a> | <a href='#snippet-disablediff' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L125-L130' title='Snippet source file'>snippet source</a> | <a href='#snippet-disablediff' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ await Verify(
Bars = await repo.GetBars(id)
});
```
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L177-L186' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifyfuncoftaskoft' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L185-L194' title='Snippet source file'>snippet source</a> | <a href='#snippet-verifyfuncoftaskoft' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
9 changes: 9 additions & 0 deletions src/Verify.Tests/Snippets/Snippets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ void AutoVerify()
#endregion
}

#region AutoVerifyFluent

[Fact]
public Task AutoVerifyFluent() =>
Verify("Value")
.AutoVerify();

#endregion

// ReSharper disable once UnusedMember.Local
void DisableDiff()
{
Expand Down

0 comments on commit 0fbbaa7

Please sign in to comment.