Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Sep 17, 2024
1 parent afcf7aa commit c3a9633
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 78 deletions.
5 changes: 5 additions & 0 deletions docs/mdsource/explicit-targets.source.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ snippet: ExplicitTargetsFixie
snippet: ExplicitTargetsMsTest


## TUnit

snippet: ExplicitTargetsTUnit


## Result

snippet: Verify.MSTest.Tests/Tests.WithTargets.verified.txt
Expand Down
5 changes: 5 additions & 0 deletions docs/mdsource/naming.source.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ snippet: UniqueForSampleMSTest
snippet: UniqueForSampleExpecto


### TUnit

snippet: UniqueForSampleTUnit


### Result

For a project executed on both x64 and x86 that targets
Expand Down
46 changes: 45 additions & 1 deletion docs/mdsource/parameterised.source.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Characters that cannot be used for a file name are replaced with a dash (`-`).
* Verify.Fixie: Automatically detects the method parameters via a [custom ITestProject]( docs/parameterised.md#fixie).
* Verify.MSTest: Does not detect the parametrised arguments, as such `UseParameters()` is required.
* Verify.NUnit: Automatically detects the method parameters. So `UseParameters()` is not required unless using custom parameters.
* Verify.TUnit: Automatically detects the method parameters. So `UseParameters()` is not required unless using custom parameters.
* Verify.Xunit: Does not detect the parametrised arguments, as such `UseParameters()` is required.
* Verify.XunitV3: Automatically detect the method parameters for built in types (string, int, bool etc), but for complex parameters `UseParameters()` is required.

Expand Down Expand Up @@ -65,6 +66,16 @@ Produces:
* `TestFixtureSourceUsage.Test_arg1=Value2_arg2=2.verified.txt`


## TUnit

`Verify.TUnit` automatically detects the method parameters. So `UseParameters()` is not required unless using custom parameters.


### TestCase

snippet: TUnitTestCase


## xUnit V2

`Verify.Xunit` does not detect the parametrized arguments, as such `UseParameters()` is required.
Expand Down Expand Up @@ -163,7 +174,7 @@ Results in:

By default, Verify expects every parameterized case to have a unique [file name](/docs/naming.md) with the parameters appended to the file name. This behavior can be overridden by using `IgnoreParametersForVerified()`. In this case, the verified file name does not contain the parameter values, meaning it is the same for each testcase.

`IgnoreParametersForVerified` accepts an array for passing through the parameters. These values are pssed to [UseParameters](#UseParameters). This is required for MSTest, xUnit, and NUnit. Parameters should not be passed for NUnit and Fixie since they are automatically detected.
`IgnoreParametersForVerified` accepts an array for passing through the parameters. These values are passed to [UseParameters](#UseParameters). This is required for MSTest, and xUnit. Parameters should not be passed for NUnit, TUnit and Fixie since they are automatically detected.

The below samples produce:

Expand Down Expand Up @@ -206,6 +217,19 @@ snippet: IgnoreParametersForVerifiedNunit
snippet: IgnoreParametersForVerifiedFluentNunit


### TUnit


#### Instance

snippet: IgnoreParametersForVerifiedTUnit


#### Fluent

snippet: IgnoreParametersForVerifiedFluentTUnit


### MSTest


Expand Down Expand Up @@ -250,6 +274,19 @@ snippet: IgnoreParametersForVerifiedCustomParamsNunit
snippet: IgnoreParametersForVerifiedCustomParamsFluentNunit


### TUnit


#### Instance

snippet: IgnoreParametersForVerifiedCustomParamsTUnit


#### Fluent

snippet: IgnoreParametersForVerifiedCustomParamsFluentTUnit


### MSTest


Expand Down Expand Up @@ -286,6 +323,13 @@ snippet: UseParametersHashNunit
Note that NUnit can derive the parameters without explicitly passing them.


### TUnit

snippet: UseParametersHashTUnit

Note that TUnit can derive the parameters without explicitly passing them.


### xUnit

snippet: UseParametersHashXunit
Expand Down
10 changes: 10 additions & 0 deletions docs/mdsource/scrubbers.source.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,11 @@ snippet: ScrubbersSampleFixie
snippet: ScrubbersSampleMSTest


### TUnit

snippet: ScrubbersSampleTUnit


### Results

snippet: Verify.Xunit.Tests/Scrubbers/ScrubbersSample.Lines.verified.txt
Expand Down Expand Up @@ -152,6 +157,11 @@ snippet: ScrubberLevelsSampleFixie
snippet: ScrubberLevelsSampleMSTest


### TUnit

snippet: ScrubberLevelsSampleTUnit


### Result

snippet: Verify.Xunit.Tests/Scrubbers/ScrubberLevelsSample.Usage.verified.txt
Expand Down
14 changes: 14 additions & 0 deletions readme.source.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[![NuGet Status](https://img.shields.io/nuget/v/Verify.Fixie.svg?label=Verify.Fixie)](https://www.nuget.org/packages/Verify.Fixie/)
[![NuGet Status](https://img.shields.io/nuget/v/Verify.Expecto.svg?label=Verify.Expecto)](https://www.nuget.org/packages/Verify.Expecto/)
[![NuGet Status](https://img.shields.io/nuget/v/Verify.MSTest.svg?label=Verify.MSTest)](https://www.nuget.org/packages/Verify.MSTest/)
[![NuGet Status](https://img.shields.io/nuget/v/Verify.TUnit.svg?label=Verify.TUnit)](https://www.nuget.org/packages/Verify.TUnit/)
[![NuGet Status](https://img.shields.io/nuget/v/Verify.ClipboardAccept.svg?label=Verify.ClipboardAccept)](https://www.nuget.org/packages/Verify.ClipboardAccept/)

Verify is a snapshot tool that simplifies the assertion of complex data models and documents.
Expand Down Expand Up @@ -49,6 +50,7 @@ Get customized instructions for the specific combination of Operating System, ID
* https://nuget.org/packages/Verify.Fixie/
* https://nuget.org/packages/Verify.Expecto/
* https://nuget.org/packages/Verify.MSTest/
* https://nuget.org/packages/Verify.TUnit/


## Snapshot management
Expand Down Expand Up @@ -119,6 +121,13 @@ Support for [Expecto](https://github.com/haf/expecto)
snippet: SampleTestExpecto


### TUnit

Support for [TUnit](https://github.com/thomhurst/TUnit)

snippet: SampleTestTUnit


#### Caveats

Due to the nature of the Expecto implementation, the following APIs in Verify are not supported.
Expand Down Expand Up @@ -294,6 +303,11 @@ snippet: VerifyChecksXunitV3
snippet: VerifyChecksNUnit


#### TUnit

snippet: VerifyChecksTUnit


## Static settings

Most settings are available at the both global level and at the instance level.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[MethodDataSource(nameof(FixtureArgs), UnfoldTuple = true)]
public class TestFixtureSourceAndTestCaseUsage(string arg1, int arg2)
public class MethodDataSourceAndTestCaseUsage(string arg1, int arg2)
{
[Test]
[Arguments("FromTestCase2")]
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

27 changes: 0 additions & 27 deletions src/Verify.TUnit.Tests/TestFixtureSourceUsage.cs

This file was deleted.

This file was deleted.

This file was deleted.

28 changes: 0 additions & 28 deletions src/Verify.TUnit.Tests/TestFixtureSourceUsageWithNamespace.cs

This file was deleted.

0 comments on commit c3a9633

Please sign in to comment.