Skip to content

Commit 9f8743c

Browse files
committed
docs
1 parent 964c604 commit 9f8743c

File tree

346 files changed

+1056
-1056
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

346 files changed

+1056
-1056
lines changed

docs/anonymous-types.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ When validating multiple instances, an [anonymous type](https://docs.microsoft.c
1313
## NUnit
1414

1515
<!-- snippet: AnonNUnit -->
16-
<a id='snippet-anonnunit'></a>
16+
<a id='snippet-AnonNUnit'></a>
1717
```cs
1818
[Test]
1919
public Task Anon()
@@ -37,14 +37,14 @@ public Task Anon()
3737
});
3838
}
3939
```
40-
<sup><a href='/src/Verify.NUnit.Tests/VerifyObjectSamples.cs#L42-L66' title='Snippet source file'>snippet source</a> | <a href='#snippet-anonnunit' title='Start of snippet'>anchor</a></sup>
40+
<sup><a href='/src/Verify.NUnit.Tests/VerifyObjectSamples.cs#L42-L66' title='Snippet source file'>snippet source</a> | <a href='#snippet-AnonNUnit' title='Start of snippet'>anchor</a></sup>
4141
<!-- endSnippet -->
4242

4343

4444
## xUnit
4545

4646
<!-- snippet: AnonXunit -->
47-
<a id='snippet-anonxunit'></a>
47+
<a id='snippet-AnonXunit'></a>
4848
```cs
4949
[Fact]
5050
public Task Anon()
@@ -68,14 +68,14 @@ public Task Anon()
6868
});
6969
}
7070
```
71-
<sup><a href='/src/Verify.Xunit.Tests/VerifyObjectSamples.cs#L23-L47' title='Snippet source file'>snippet source</a> | <a href='#snippet-anonxunit' title='Start of snippet'>anchor</a></sup>
71+
<sup><a href='/src/Verify.Xunit.Tests/VerifyObjectSamples.cs#L23-L47' title='Snippet source file'>snippet source</a> | <a href='#snippet-AnonXunit' title='Start of snippet'>anchor</a></sup>
7272
<!-- endSnippet -->
7373

7474

7575
## Fixie
7676

7777
<!-- snippet: AnonFixie -->
78-
<a id='snippet-anonfixie'></a>
78+
<a id='snippet-AnonFixie'></a>
7979
```cs
8080
public Task Anon()
8181
{
@@ -98,14 +98,14 @@ public Task Anon()
9898
});
9999
}
100100
```
101-
<sup><a href='/src/Verify.Fixie.Tests/VerifyObjectSamples.cs#L39-L62' title='Snippet source file'>snippet source</a> | <a href='#snippet-anonfixie' title='Start of snippet'>anchor</a></sup>
101+
<sup><a href='/src/Verify.Fixie.Tests/VerifyObjectSamples.cs#L39-L62' title='Snippet source file'>snippet source</a> | <a href='#snippet-AnonFixie' title='Start of snippet'>anchor</a></sup>
102102
<!-- endSnippet -->
103103

104104

105105
## MSTest
106106

107107
<!-- snippet: AnonMSTest -->
108-
<a id='snippet-anonmstest'></a>
108+
<a id='snippet-AnonMSTest'></a>
109109
```cs
110110
[TestMethod]
111111
public Task Anon()
@@ -129,7 +129,7 @@ public Task Anon()
129129
});
130130
}
131131
```
132-
<sup><a href='/src/Verify.MSTest.Tests/VerifyObjectSamples.cs#L27-L51' title='Snippet source file'>snippet source</a> | <a href='#snippet-anonmstest' title='Start of snippet'>anchor</a></sup>
132+
<sup><a href='/src/Verify.MSTest.Tests/VerifyObjectSamples.cs#L27-L51' title='Snippet source file'>snippet source</a> | <a href='#snippet-AnonMSTest' title='Start of snippet'>anchor</a></sup>
133133
<!-- endSnippet -->
134134

135135

docs/append-file.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ Allows extra files to be verified in addition to the primary target.
1313
## AppendFile
1414

1515
<!-- snippet: AppendFile -->
16-
<a id='snippet-appendfile'></a>
16+
<a id='snippet-AppendFile'></a>
1717
```cs
1818
[Fact]
1919
public Task AppendFile() =>
2020
Verify("Foo", settings)
2121
.AppendFile("sample.png");
2222
```
23-
<sup><a href='/src/Verify.Tests/Converters/InstanceFileAppenderTests.cs#L20-L27' title='Snippet source file'>snippet source</a> | <a href='#snippet-appendfile' title='Start of snippet'>anchor</a></sup>
23+
<sup><a href='/src/Verify.Tests/Converters/InstanceFileAppenderTests.cs#L20-L27' title='Snippet source file'>snippet source</a> | <a href='#snippet-AppendFile' title='Start of snippet'>anchor</a></sup>
2424
<!-- endSnippet -->
2525

2626
Will result in two files being verified:
@@ -32,14 +32,14 @@ Will result in two files being verified:
3232
## AppendContentAsFile
3333

3434
<!-- snippet: AppendContentAsFile -->
35-
<a id='snippet-appendcontentasfile'></a>
35+
<a id='snippet-AppendContentAsFile'></a>
3636
```cs
3737
[Fact]
3838
public Task AppendContentAsFile() =>
3939
Verify("Foo")
4040
.AppendContentAsFile("extra content");
4141
```
42-
<sup><a href='/src/Verify.Tests/Converters/InstanceFileAppenderTests.cs#L29-L36' title='Snippet source file'>snippet source</a> | <a href='#snippet-appendcontentasfile' title='Start of snippet'>anchor</a></sup>
42+
<sup><a href='/src/Verify.Tests/Converters/InstanceFileAppenderTests.cs#L29-L36' title='Snippet source file'>snippet source</a> | <a href='#snippet-AppendContentAsFile' title='Start of snippet'>anchor</a></sup>
4343
<!-- endSnippet -->
4444

4545
Will result in two files being verified:

docs/binary.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Binary data can be verified by passing a stream.
1212
To know how to treat the stream, an extension needs to be provided:
1313

1414
<!-- snippet: StreamWithExtension -->
15-
<a id='snippet-streamwithextension'></a>
15+
<a id='snippet-StreamWithExtension'></a>
1616
```cs
1717
[Fact]
1818
public Task StreamWithExtension()
@@ -21,19 +21,19 @@ public Task StreamWithExtension()
2121
return Verify(stream, "png");
2222
}
2323
```
24-
<sup><a href='/src/Verify.Tests/StreamTests.cs#L91-L100' title='Snippet source file'>snippet source</a> | <a href='#snippet-streamwithextension' title='Start of snippet'>anchor</a></sup>
24+
<sup><a href='/src/Verify.Tests/StreamTests.cs#L91-L100' title='Snippet source file'>snippet source</a> | <a href='#snippet-StreamWithExtension' title='Start of snippet'>anchor</a></sup>
2525
<!-- endSnippet -->
2626

2727
For a `FileStream` the extension is not required:
2828

2929
<!-- snippet: FileStream -->
30-
<a id='snippet-filestream'></a>
30+
<a id='snippet-FileStream'></a>
3131
```cs
3232
[Fact]
3333
public Task FileStream() =>
3434
Verify(File.OpenRead("sample.txt"));
3535
```
36-
<sup><a href='/src/Verify.Tests/StreamTests.cs#L102-L108' title='Snippet source file'>snippet source</a> | <a href='#snippet-filestream' title='Start of snippet'>anchor</a></sup>
36+
<sup><a href='/src/Verify.Tests/StreamTests.cs#L102-L108' title='Snippet source file'>snippet source</a> | <a href='#snippet-FileStream' title='Start of snippet'>anchor</a></sup>
3737
<!-- endSnippet -->
3838

3939

docs/build-server.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ In some scenarios, as part of a build, the test assemblies are copied to a diffe
8686
For example a possible implementation for [AppVeyor](https://www.appveyor.com/) could be:
8787

8888
<!-- snippet: DerivePathInfoAppVeyor -->
89-
<a id='snippet-derivepathinfoappveyor'></a>
89+
<a id='snippet-DerivePathInfoAppVeyor'></a>
9090
```cs
9191
if (BuildServerDetector.Detected)
9292
{
@@ -100,5 +100,5 @@ if (BuildServerDetector.Detected)
100100
});
101101
}
102102
```
103-
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L56-L70' title='Snippet source file'>snippet source</a> | <a href='#snippet-derivepathinfoappveyor' title='Start of snippet'>anchor</a></sup>
103+
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L56-L70' title='Snippet source file'>snippet source</a> | <a href='#snippet-DerivePathInfoAppVeyor' title='Start of snippet'>anchor</a></sup>
104104
<!-- endSnippet -->

docs/clipboard.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ Clipboard support is shipped via the [Verify.ClipboardAccept nuget](https://www.
2121
The clipboard behavior can be enabled using the following:
2222

2323
<!-- snippet: EnableClipboard -->
24-
<a id='snippet-enableclipboard'></a>
24+
<a id='snippet-EnableClipboard'></a>
2525
```cs
2626
ClipboardAccept.Enable();
2727
```
28-
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L30-L34' title='Snippet source file'>snippet source</a> | <a href='#snippet-enableclipboard' title='Start of snippet'>anchor</a></sup>
28+
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L30-L34' title='Snippet source file'>snippet source</a> | <a href='#snippet-EnableClipboard' title='Start of snippet'>anchor</a></sup>
2929
<!-- endSnippet -->
3030

3131

docs/compared-to-assertion.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Given the following method:
2626
### Class being tested
2727

2828
<!-- snippet: ClassBeingTested -->
29-
<a id='snippet-classbeingtested'></a>
29+
<a id='snippet-ClassBeingTested'></a>
3030
```cs
3131
public static class ClassBeingTested
3232
{
@@ -51,7 +51,7 @@ public static class ClassBeingTested
5151
};
5252
}
5353
```
54-
<sup><a href='/src/TargetLibrary/ClassBeingTested.cs#L1-L26' title='Snippet source file'>snippet source</a> | <a href='#snippet-classbeingtested' title='Start of snippet'>anchor</a></sup>
54+
<sup><a href='/src/TargetLibrary/ClassBeingTested.cs#L1-L26' title='Snippet source file'>snippet source</a> | <a href='#snippet-ClassBeingTested' title='Start of snippet'>anchor</a></sup>
5555
<!-- endSnippet -->
5656

5757

@@ -63,7 +63,7 @@ Compare a traditional assertion based test to a verification test.
6363
#### Traditional assertion test:
6464

6565
<!-- snippet: TraditionalTest -->
66-
<a id='snippet-traditionaltest'></a>
66+
<a id='snippet-TraditionalTest'></a>
6767
```cs
6868
[Fact]
6969
public void TraditionalTest()
@@ -81,14 +81,14 @@ public void TraditionalTest()
8181
Assert.Equal("USA", person.Address.Country);
8282
}
8383
```
84-
<sup><a href='/src/Verify.Xunit.Tests/Snippets/CompareToAssert.cs#L3-L21' title='Snippet source file'>snippet source</a> | <a href='#snippet-traditionaltest' title='Start of snippet'>anchor</a></sup>
84+
<sup><a href='/src/Verify.Xunit.Tests/Snippets/CompareToAssert.cs#L3-L21' title='Snippet source file'>snippet source</a> | <a href='#snippet-TraditionalTest' title='Start of snippet'>anchor</a></sup>
8585
<!-- endSnippet -->
8686

8787

8888
#### Snapshot test
8989

9090
<!-- snippet: SnapshotTest -->
91-
<a id='snippet-snapshottest'></a>
91+
<a id='snippet-SnapshotTest'></a>
9292
```cs
9393
[Fact]
9494
public Task SnapshotTest()
@@ -97,7 +97,7 @@ public Task SnapshotTest()
9797
return Verify(person);
9898
}
9999
```
100-
<sup><a href='/src/Verify.Xunit.Tests/Snippets/CompareToAssert.cs#L23-L32' title='Snippet source file'>snippet source</a> | <a href='#snippet-snapshottest' title='Start of snippet'>anchor</a></sup>
100+
<sup><a href='/src/Verify.Xunit.Tests/Snippets/CompareToAssert.cs#L23-L32' title='Snippet source file'>snippet source</a> | <a href='#snippet-SnapshotTest' title='Start of snippet'>anchor</a></sup>
101101
<!-- endSnippet -->
102102

103103
Produces a snapshot file `SnapshotTest.verified.txt`:

docs/comparer.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Using a custom comparer can be helpful when a result has changed, but not enough
1717
For samples purposes only the image sizes will be compared:
1818

1919
<!-- snippet: ImageComparer -->
20-
<a id='snippet-imagecomparer'></a>
20+
<a id='snippet-ImageComparer'></a>
2121
```cs
2222
static Task<CompareResult> CompareImages(
2323
Stream received,
@@ -34,7 +34,7 @@ static Task<CompareResult> CompareImages(
3434
return Task.FromResult(result);
3535
}
3636
```
37-
<sup><a href='/src/Verify.Tests/Snippets/ComparerSnippets.cs#L34-L51' title='Snippet source file'>snippet source</a> | <a href='#snippet-imagecomparer' title='Start of snippet'>anchor</a></sup>
37+
<sup><a href='/src/Verify.Tests/Snippets/ComparerSnippets.cs#L34-L51' title='Snippet source file'>snippet source</a> | <a href='#snippet-ImageComparer' title='Start of snippet'>anchor</a></sup>
3838
<!-- endSnippet -->
3939

4040
The returned `CompareResult.NotEqual` takes an optional message that will be rendered in the resulting text displayed to the user on test failure.
@@ -45,7 +45,7 @@ The returned `CompareResult.NotEqual` takes an optional message that will be ren
4545
### Instance comparer
4646

4747
<!-- snippet: InstanceComparer -->
48-
<a id='snippet-instancecomparer'></a>
48+
<a id='snippet-InstanceComparer'></a>
4949
```cs
5050
[Fact]
5151
public Task InstanceComparer()
@@ -60,28 +60,28 @@ public Task InstanceComparerFluent() =>
6060
VerifyFile("sample.png")
6161
.UseStreamComparer(CompareImages);
6262
```
63-
<sup><a href='/src/Verify.Tests/Snippets/ComparerSnippets.cs#L5-L20' title='Snippet source file'>snippet source</a> | <a href='#snippet-instancecomparer' title='Start of snippet'>anchor</a></sup>
63+
<sup><a href='/src/Verify.Tests/Snippets/ComparerSnippets.cs#L5-L20' title='Snippet source file'>snippet source</a> | <a href='#snippet-InstanceComparer' title='Start of snippet'>anchor</a></sup>
6464
<!-- endSnippet -->
6565

6666

6767
### Static comparer
6868

6969
<!-- snippet: StaticComparer -->
70-
<a id='snippet-staticcomparer'></a>
70+
<a id='snippet-StaticComparer'></a>
7171
```cs
7272
VerifierSettings.RegisterStreamComparer(
7373
extension: "png",
7474
compare: CompareImages);
7575
await VerifyFile("TheImage.png");
7676
```
77-
<sup><a href='/src/Verify.Tests/Snippets/ComparerSnippets.cs#L24-L31' title='Snippet source file'>snippet source</a> | <a href='#snippet-staticcomparer' title='Start of snippet'>anchor</a></sup>
77+
<sup><a href='/src/Verify.Tests/Snippets/ComparerSnippets.cs#L24-L31' title='Snippet source file'>snippet source</a> | <a href='#snippet-StaticComparer' title='Start of snippet'>anchor</a></sup>
7878
<!-- endSnippet -->
7979

8080

8181
## Default Comparison
8282

8383
<!-- snippet: DefualtCompare -->
84-
<a id='snippet-defualtcompare'></a>
84+
<a id='snippet-DefualtCompare'></a>
8585
```cs
8686
const int bufferSize = 1024 * sizeof(long);
8787

@@ -143,7 +143,7 @@ static async Task<int> ReadBufferAsync(Stream stream, byte[] buffer)
143143
return bytesRead;
144144
}
145145
```
146-
<sup><a href='/src/Verify/Compare/StreamComparer.cs#L3-L65' title='Snippet source file'>snippet source</a> | <a href='#snippet-defualtcompare' title='Start of snippet'>anchor</a></sup>
146+
<sup><a href='/src/Verify/Compare/StreamComparer.cs#L3-L65' title='Snippet source file'>snippet source</a> | <a href='#snippet-DefualtCompare' title='Start of snippet'>anchor</a></sup>
147147
<!-- endSnippet -->
148148

149149

docs/converter.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Multiple png files:
4949
This sample uses a typed approach. So the converter acts on an in memory instance matching based on type.
5050

5151
<!-- snippet: RegisterFileConverterType -->
52-
<a id='snippet-registerfileconvertertype'></a>
52+
<a id='snippet-RegisterFileConverterType'></a>
5353
```cs
5454
VerifierSettings.RegisterFileConverter<Image>(
5555

@@ -78,26 +78,26 @@ VerifierSettings.RegisterFileConverter<Image>(
7878
targets);
7979
});
8080
```
81-
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L10-L43' title='Snippet source file'>snippet source</a> | <a href='#snippet-registerfileconvertertype' title='Start of snippet'>anchor</a></sup>
81+
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L10-L43' title='Snippet source file'>snippet source</a> | <a href='#snippet-RegisterFileConverterType' title='Start of snippet'>anchor</a></sup>
8282
<!-- endSnippet -->
8383

8484
<!-- snippet: FileConverterTypeVerify -->
85-
<a id='snippet-fileconvertertypeverify'></a>
85+
<a id='snippet-FileConverterTypeVerify'></a>
8686
```cs
8787
using var stream = File.OpenRead("sample.tif");
8888
await Verify(Image.FromStream(stream));
8989
```
90-
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L49-L54' title='Snippet source file'>snippet source</a> | <a href='#snippet-fileconvertertypeverify' title='Start of snippet'>anchor</a></sup>
90+
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L49-L54' title='Snippet source file'>snippet source</a> | <a href='#snippet-FileConverterTypeVerify' title='Start of snippet'>anchor</a></sup>
9191
<!-- endSnippet -->
9292

9393
Note that this sample also uses the optional `canConvert` to ensure that only `Image`s that are tiffs are converted.
9494

9595
<!-- snippet: ConverterCanConvert -->
96-
<a id='snippet-convertercanconvert'></a>
96+
<a id='snippet-ConverterCanConvert'></a>
9797
```cs
9898
canConvert: (target, context) => Equals(target.RawFormat, ImageFormat.Tiff),
9999
```
100-
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L14-L18' title='Snippet source file'>snippet source</a> | <a href='#snippet-convertercanconvert' title='Start of snippet'>anchor</a></sup>
100+
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L14-L18' title='Snippet source file'>snippet source</a> | <a href='#snippet-ConverterCanConvert' title='Start of snippet'>anchor</a></sup>
101101
<!-- endSnippet -->
102102

103103

@@ -106,7 +106,7 @@ canConvert: (target, context) => Equals(target.RawFormat, ImageFormat.Tiff),
106106
This sample uses a extension approach. So the converter acts on a file or stream based on the extension (configured or detected).
107107

108108
<!-- snippet: RegisterFileConverterExtension -->
109-
<a id='snippet-registerfileconverterextension'></a>
109+
<a id='snippet-RegisterFileConverterExtension'></a>
110110
```cs
111111
VerifierSettings.RegisterFileConverter(
112112
fromExtension: "tif",
@@ -134,15 +134,15 @@ VerifierSettings.RegisterFileConverter(
134134
targets);
135135
});
136136
```
137-
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L60-L88' title='Snippet source file'>snippet source</a> | <a href='#snippet-registerfileconverterextension' title='Start of snippet'>anchor</a></sup>
137+
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L60-L88' title='Snippet source file'>snippet source</a> | <a href='#snippet-RegisterFileConverterExtension' title='Start of snippet'>anchor</a></sup>
138138
<!-- endSnippet -->
139139

140140
<!-- snippet: FileConverterExtensionVerify -->
141-
<a id='snippet-fileconverterextensionverify'></a>
141+
<a id='snippet-FileConverterExtensionVerify'></a>
142142
```cs
143143
await VerifyFile("sample.tif");
144144
```
145-
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L94-L98' title='Snippet source file'>snippet source</a> | <a href='#snippet-fileconverterextensionverify' title='Start of snippet'>anchor</a></sup>
145+
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L94-L98' title='Snippet source file'>snippet source</a> | <a href='#snippet-FileConverterExtensionVerify' title='Start of snippet'>anchor</a></sup>
146146
<!-- endSnippet -->
147147

148148

@@ -151,7 +151,7 @@ await VerifyFile("sample.tif");
151151
If cleanup needs to occur after verification a callback can be passes to `ConversionResult`:
152152

153153
<!-- snippet: ConversionResultWithCleanup -->
154-
<a id='snippet-conversionresultwithcleanup'></a>
154+
<a id='snippet-ConversionResultWithCleanup'></a>
155155
```cs
156156
return new(
157157
info: null,
@@ -163,7 +163,7 @@ return new(
163163
return Task.CompletedTask;
164164
});
165165
```
166-
<sup><a href='/src/Verify.Tests/Converters/TypeConverterTests.cs#L32-L44' title='Snippet source file'>snippet source</a> | <a href='#snippet-conversionresultwithcleanup' title='Start of snippet'>anchor</a></sup>
166+
<sup><a href='/src/Verify.Tests/Converters/TypeConverterTests.cs#L32-L44' title='Snippet source file'>snippet source</a> | <a href='#snippet-ConversionResultWithCleanup' title='Start of snippet'>anchor</a></sup>
167167
<!-- endSnippet -->
168168

169169

0 commit comments

Comments
 (0)