Skip to content

Commit

Permalink
Bump MarkdownSnippets.MsBuild from 21.4.0 to 21.5.0 (#230)
Browse files Browse the repository at this point in the history
* Bump MarkdownSnippets.MsBuild from 21.4.0 to 21.5.0

Bumps [MarkdownSnippets.MsBuild](https://github.com/SimonCropp/MarkdownSnippets) from 21.4.0 to 21.5.0.
- [Release notes](https://github.com/SimonCropp/MarkdownSnippets/releases)
- [Commits](https://github.com/SimonCropp/MarkdownSnippets/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* Docs changes

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: GitHub Action <action@github.com>
  • Loading branch information
dependabot-preview[bot] and actions-user authored Oct 10, 2020
1 parent f143afe commit 4cf8691
Show file tree
Hide file tree
Showing 14 changed files with 201 additions and 201 deletions.
16 changes: 8 additions & 8 deletions docs/anonymous-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ When validating multiple instances, an [anonymous type](https://docs.microsoft.c
## xUnit

<!-- snippet: anonXunit -->
<a id='ec22c684'></a>
<a id='anonxunit'></a>
```cs
[Fact]
public async Task Anon()
Expand All @@ -37,14 +37,14 @@ public async Task Anon()
});
}
```
<sup><a href='/src/Verify.Xunit.Tests/VerifyObjectSamples.cs#L65-L87' title='Snippet source file'>snippet source</a> | <a href='#ec22c684' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Xunit.Tests/VerifyObjectSamples.cs#L65-L87' title='Snippet source file'>snippet source</a> | <a href='#anonxunit' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


## NUnit

<!-- snippet: anonNUnit -->
<a id='7c082449'></a>
<a id='anonnunit'></a>
```cs
[Test]
public async Task Anon()
Expand All @@ -68,14 +68,14 @@ public async Task Anon()
});
}
```
<sup><a href='/src/Verify.NUnit.Tests/VerifyObjectSamples.cs#L68-L90' title='Snippet source file'>snippet source</a> | <a href='#7c082449' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.NUnit.Tests/VerifyObjectSamples.cs#L68-L90' title='Snippet source file'>snippet source</a> | <a href='#anonnunit' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


## MSTest

<!-- snippet: anonMSTest -->
<a id='91d43f07'></a>
<a id='anonmstest'></a>
```cs
[TestMethod]
public async Task Anon()
Expand All @@ -99,7 +99,7 @@ public async Task Anon()
});
}
```
<sup><a href='/src/Verify.MSTest.Tests/VerifyObjectSamples.cs#L67-L89' title='Snippet source file'>snippet source</a> | <a href='#91d43f07' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.MSTest.Tests/VerifyObjectSamples.cs#L67-L89' title='Snippet source file'>snippet source</a> | <a href='#anonmstest' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -108,7 +108,7 @@ public async Task Anon()
Results in the following:

<!-- snippet: Verify.Xunit.Tests/VerifyObjectSamples.Anon.verified.txt -->
<a id='2753b441'></a>
<a id='Verify.Xunit.Tests/VerifyObjectSamples.Anon.verified.txt'></a>
```txt
{
person1: {
Expand All @@ -121,5 +121,5 @@ Results in the following:
}
}
```
<sup><a href='/src/Verify.Xunit.Tests/VerifyObjectSamples.Anon.verified.txt#L1-L10' title='Snippet source file'>snippet source</a> | <a href='#2753b441' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Xunit.Tests/VerifyObjectSamples.Anon.verified.txt#L1-L10' title='Snippet source file'>snippet source</a> | <a href='#Verify.Xunit.Tests/VerifyObjectSamples.Anon.verified.txt' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->
8 changes: 4 additions & 4 deletions docs/build-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ To change this file edit the source file and then run MarkdownSnippets.
Use an [on_failure build step](https://www.appveyor.com/docs/build-configuration/#build-pipeline) to call [Push-AppveyorArtifact](https://www.appveyor.com/docs/build-worker-api/#push-artifact).

<!-- snippet: AppVeyorArtifacts -->
<a id='e3c08388'></a>
<a id='appveyorartifacts'></a>
```yml
on_failure:
- ps: Get-ChildItem *.received.* -recurse | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
```
<sup><a href='/src/appveyor.yml#L9-L12' title='Snippet source file'>snippet source</a> | <a href='#e3c08388' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/appveyor.yml#L9-L12' title='Snippet source file'>snippet source</a> | <a href='#appveyorartifacts' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->
See also [Pushing artifacts from scripts](https://www.appveyor.com/docs/packaging-artifacts/#pushing-artifacts-from-scripts).
Expand All @@ -38,7 +38,7 @@ In some scenarios, as part of a build, the test assemblies are copied to a diffe
For example a possible implementation for [AppVeyor](https://www.appveyor.com/) could be:

<!-- snippet: DeriveTestDirectory -->
<a id='8f61e7f7'></a>
<a id='derivetestdirectory'></a>
```cs
if (BuildServerDetector.Detected)
{
Expand All @@ -52,5 +52,5 @@ if (BuildServerDetector.Detected)
});
}
```
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L82-L96' title='Snippet source file'>snippet source</a> | <a href='#8f61e7f7' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L82-L96' title='Snippet source file'>snippet source</a> | <a href='#derivetestdirectory' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->
12 changes: 6 additions & 6 deletions docs/clipboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,34 +62,34 @@ The clipboard behavior can be disable using the following:
### Per Test

<!-- snippet: DisableClipboard -->
<a id='4855b889'></a>
<a id='disableclipboard'></a>
```cs
var settings = new VerifySettings();
settings.DisableClipboard();
```
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L38-L43' title='Snippet source file'>snippet source</a> | <a href='#4855b889' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L38-L43' title='Snippet source file'>snippet source</a> | <a href='#disableclipboard' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


### For all tests

<!-- snippet: DisableClipboardGlobal -->
<a id='2c70d654'></a>
<a id='disableclipboardglobal'></a>
```cs
VerifierSettings.DisableClipboard();
```
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L73-L77' title='Snippet source file'>snippet source</a> | <a href='#2c70d654' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L73-L77' title='Snippet source file'>snippet source</a> | <a href='#disableclipboardglobal' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

If clipboard is disabled for all tests, it can be re-enabled at the test level:

<!-- snippet: EnableClipboard -->
<a id='2ac46c35'></a>
<a id='enableclipboard'></a>
```cs
var settings = new VerifySettings();
settings.EnableClipboard();
```
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L63-L68' title='Snippet source file'>snippet source</a> | <a href='#2ac46c35' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/Snippets.cs#L63-L68' title='Snippet source file'>snippet source</a> | <a href='#enableclipboard' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
12 changes: 6 additions & 6 deletions docs/compared-to-assertion.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Given the following method:
### Class being tested

<!-- snippet: ClassBeingTested -->
<a id='1dbe2b6f'></a>
<a id='classbeingtested'></a>
```cs
public static class ClassBeingTested
{
Expand All @@ -53,7 +53,7 @@ public static class ClassBeingTested
}
}
```
<sup><a href='/src/TargetLibrary/ClassBeingTested.cs#L4-L29' title='Snippet source file'>snippet source</a> | <a href='#1dbe2b6f' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/TargetLibrary/ClassBeingTested.cs#L4-L29' title='Snippet source file'>snippet source</a> | <a href='#classbeingtested' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -65,7 +65,7 @@ Compare a traditional assertion based test to a verification test.
#### Traditional assertion test:

<!-- snippet: TraditionalTest -->
<a id='8792aba5'></a>
<a id='traditionaltest'></a>
```cs
[Fact]
public void TraditionalTest()
Expand All @@ -83,14 +83,14 @@ public void TraditionalTest()
Assert.Equal("USA", person.Address.Country);
}
```
<sup><a href='/src/Verify.Xunit.Tests/Snippets/CompareToAssert.cs#L9-L25' title='Snippet source file'>snippet source</a> | <a href='#8792aba5' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Xunit.Tests/Snippets/CompareToAssert.cs#L9-L25' title='Snippet source file'>snippet source</a> | <a href='#traditionaltest' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


#### Verification test

<!-- snippet: VerificationTest -->
<a id='2dee7ce8'></a>
<a id='verificationtest'></a>
```cs
[Fact]
public Task Simple()
Expand All @@ -99,5 +99,5 @@ public Task Simple()
return Verifier.Verify(person);
}
```
<sup><a href='/src/Verify.Xunit.Tests/Snippets/CompareToAssert.cs#L27-L34' title='Snippet source file'>snippet source</a> | <a href='#2dee7ce8' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Xunit.Tests/Snippets/CompareToAssert.cs#L27-L34' title='Snippet source file'>snippet source</a> | <a href='#verificationtest' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->
16 changes: 8 additions & 8 deletions docs/comparer.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Using a custom comparer can be helpful when a result has changed, but not enough
For samples purposes an image difference hash algorithm from the [ImageHash project](https://github.com/pgrho/phash) will be used:

<!-- snippet: ImageComparer -->
<a id='70963945'></a>
<a id='imagecomparer'></a>
```cs
static Task<CompareResult> CompareImages(
VerifySettings settings,
Expand All @@ -44,7 +44,7 @@ static Digest HashImage(Stream stream)
return ImagePhash.ComputeDigest(bitmap.ToLuminanceImage());
}
```
<sup><a href='/src/Verify.Tests/Snippets/ComparerSnippets.cs#L32-L57' title='Snippet source file'>snippet source</a> | <a href='#70963945' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/ComparerSnippets.cs#L32-L57' title='Snippet source file'>snippet source</a> | <a href='#imagecomparer' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

The returned `CompareResult.NotEqual` takes an optional message that will be rendered in the resulting text displayed to the user on test failure.
Expand All @@ -53,35 +53,35 @@ The returned `CompareResult.NotEqual` takes an optional message that will be ren
### Instance comparer

<!-- snippet: InstanceComparer -->
<a id='4b2c9ce4'></a>
<a id='instancecomparer'></a>
```cs
var settings = new VerifySettings();
settings.UseComparer(CompareImages);
settings.UseExtension("png");
await Verifier.Verify("TheImage.png", settings);
```
<sup><a href='/src/Verify.Tests/Snippets/ComparerSnippets.cs#L14-L19' title='Snippet source file'>snippet source</a> | <a href='#4b2c9ce4' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/ComparerSnippets.cs#L14-L19' title='Snippet source file'>snippet source</a> | <a href='#instancecomparer' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


### Static comparer

<!-- snippet: StaticComparer -->
<a id='5586ff0e'></a>
<a id='staticcomparer'></a>
```cs
VerifierSettings.RegisterComparer(
extension: "png",
compare: CompareImages);
await Verifier.VerifyFile("TheImage.png");
```
<sup><a href='/src/Verify.Tests/Snippets/ComparerSnippets.cs#L24-L29' title='Snippet source file'>snippet source</a> | <a href='#5586ff0e' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/ComparerSnippets.cs#L24-L29' title='Snippet source file'>snippet source</a> | <a href='#staticcomparer' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


## Default Comparison

<!-- snippet: DefualtCompare -->
<a id='c362c902'></a>
<a id='defualtcompare'></a>
```cs
static async Task<CompareResult> StreamsAreEqual(Stream stream1, Stream stream2)
{
Expand Down Expand Up @@ -131,7 +131,7 @@ static async Task<int> ReadBufferAsync(Stream stream, byte[] buffer)
return bytesRead;
}
```
<sup><a href='/src/Verify/Compare/FileComparer.cs#L73-L121' title='Snippet source file'>snippet source</a> | <a href='#c362c902' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify/Compare/FileComparer.cs#L73-L121' title='Snippet source file'>snippet source</a> | <a href='#defualtcompare' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
28 changes: 14 additions & 14 deletions docs/converter.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ Both the following examples take an input tiff and convert it to:
The info file:

<!-- snippet: ConverterSnippets.Type.info.verified.txt -->
<a id='58bc1827'></a>
<a id='ConverterSnippets.Type.info.verified.txt'></a>
```txt
{
PixelFormat: 'Format8bppIndexed',
Size: '473, 355'
}
```
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.Type.info.verified.txt#L1-L4' title='Snippet source file'>snippet source</a> | <a href='#58bc1827' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.Type.info.verified.txt#L1-L4' title='Snippet source file'>snippet source</a> | <a href='#ConverterSnippets.Type.info.verified.txt' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

Multiple png files:
Expand All @@ -49,7 +49,7 @@ Multiple png files:
This sample uses a typed approach. So the converter acts on an in memory instance matching based on type.

<!-- snippet: RegisterFileConverterType -->
<a id='9b5c4e65'></a>
<a id='registerfileconvertertype'></a>
```cs
VerifierSettings.RegisterFileConverter<Image>(
canConvert: (target, settings) => Equals(target.RawFormat, ImageFormat.Tiff),
Expand All @@ -76,26 +76,26 @@ VerifierSettings.RegisterFileConverter<Image>(
streams);
});
```
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L17-L45' title='Snippet source file'>snippet source</a> | <a href='#9b5c4e65' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L17-L45' title='Snippet source file'>snippet source</a> | <a href='#registerfileconvertertype' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

<!-- snippet: FileConverterTypeVerify -->
<a id='28f53c67'></a>
<a id='fileconvertertypeverify'></a>
```cs
using var stream = File.OpenRead("sample.tif");
await Verifier.Verify(Image.FromStream(stream));
```
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L47-L50' title='Snippet source file'>snippet source</a> | <a href='#28f53c67' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L47-L50' title='Snippet source file'>snippet source</a> | <a href='#fileconvertertypeverify' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

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

<!-- snippet: ConverterCanConvert -->
<a id='464e8a44'></a>
<a id='convertercanconvert'></a>
```cs
canConvert: (target, settings) => Equals(target.RawFormat, ImageFormat.Tiff),
```
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L19-L21' title='Snippet source file'>snippet source</a> | <a href='#464e8a44' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L19-L21' title='Snippet source file'>snippet source</a> | <a href='#convertercanconvert' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


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

<!-- snippet: RegisterFileConverterExtension -->
<a id='9e00c303'></a>
<a id='registerfileconverterextension'></a>
```cs
VerifierSettings.RegisterFileConverter(
fromExtension: "tif",
Expand Down Expand Up @@ -132,15 +132,15 @@ VerifierSettings.RegisterFileConverter(
streams);
});
```
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L56-L83' title='Snippet source file'>snippet source</a> | <a href='#9e00c303' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L56-L83' title='Snippet source file'>snippet source</a> | <a href='#registerfileconverterextension' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

<!-- snippet: FileConverterExtensionVerify -->
<a id='82adb3bf'></a>
<a id='fileconverterextensionverify'></a>
```cs
await Verifier.VerifyFile("sample.tif");
```
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L84-L86' title='Snippet source file'>snippet source</a> | <a href='#82adb3bf' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Snippets/ConverterSnippets.cs#L84-L86' title='Snippet source file'>snippet source</a> | <a href='#fileconverterextensionverify' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


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

<!-- snippet: ConversionResultWithCleanup -->
<a id='2ef9ecde'></a>
<a id='conversionresultwithcleanup'></a>
```cs
return new ConversionResult(
info: info,
Expand All @@ -161,7 +161,7 @@ return new ConversionResult(
return Task.CompletedTask;
});
```
<sup><a href='/src/Verify.Tests/Converters/TypeConverterTests.cs#L63-L73' title='Snippet source file'>snippet source</a> | <a href='#2ef9ecde' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.Tests/Converters/TypeConverterTests.cs#L63-L73' title='Snippet source file'>snippet source</a> | <a href='#conversionresultwithcleanup' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
Loading

0 comments on commit 4cf8691

Please sign in to comment.