Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Oct 12, 2024
1 parent 596d7cb commit 6563ee3
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 35 deletions.
2 changes: 1 addition & 1 deletion docs/explicit-targets.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public Task WithTargets() =>
name: "targetName")
]);
```
<sup><a href='/src/Verify.NUnit.Tests/Tests.cs#L38-L54' title='Snippet source file'>snippet source</a> | <a href='#snippet-ExplicitTargetsNunit' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.NUnit.Tests/Tests.cs#L33-L49' title='Snippet source file'>snippet source</a> | <a href='#snippet-ExplicitTargetsNunit' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
9 changes: 8 additions & 1 deletion docs/mdsource/parameterised-nunit.source.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,14 @@ Produces:
include: override-parameters-text


snippet: UseTextForParameters
### Instance

snippet: UseTextForParametersInstanceNunit


### Fluent

snippet: UseTextForParametersFluentNunit


## Ignore parameters for verified filename
Expand Down
29 changes: 20 additions & 9 deletions docs/parameterised-nunit.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public Task UseParametersSubSet(string arg1, string arg2, string arg3)
.UseParameters(arg1, arg2);
}
```
<sup><a href='/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs#L35-L45' title='Snippet source file'>snippet source</a> | <a href='#snippet-UseParametersSubSetNunit' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs#L39-L49' title='Snippet source file'>snippet source</a> | <a href='#snippet-UseParametersSubSetNunit' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->

If the number of parameters passed to `UseParameters()` is greater than the number of parameters in the test method, an exception will be thrown.
Expand All @@ -43,7 +43,7 @@ If the number of parameters passed to `UseParameters()` is greater than the numb
public Task TestCaseUsage(string arg) =>
Verify(arg);
```
<sup><a href='/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs#L139-L146' title='Snippet source file'>snippet source</a> | <a href='#snippet-NUnitTestCase' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs#L143-L150' title='Snippet source file'>snippet source</a> | <a href='#snippet-NUnitTestCase' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down Expand Up @@ -111,8 +111,10 @@ For the fluent case:
* TheTest.UseTextForParametersFluent_Value2.verified.txt<!-- endInclude -->


<!-- snippet: UseTextForParameters -->
<a id='snippet-UseTextForParameters'></a>
### Instance

<!-- snippet: UseTextForParametersInstanceNunit -->
<a id='snippet-UseTextForParametersInstanceNunit'></a>
```cs
[TestCase("Value1")]
[TestCase("Value2")]
Expand All @@ -122,14 +124,23 @@ public Task UseTextForParameters(string arg)
settings.UseTextForParameters(arg);
return Verify(arg + "UseTextForParameters", settings);
}
```
<sup><a href='/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs#L16-L27' title='Snippet source file'>snippet source</a> | <a href='#snippet-UseTextForParametersInstanceNunit' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


### Fluent

<!-- snippet: UseTextForParametersFluentNunit -->
<a id='snippet-UseTextForParametersFluentNunit'></a>
```cs
[TestCase("Value1")]
[TestCase("Value2")]
public Task UseTextForParametersFluent(string arg) =>
Verify(arg + "UseTextForParametersFluent")
.UseTextForParameters(arg);
```
<sup><a href='/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs#L16-L33' title='Snippet source file'>snippet source</a> | <a href='#snippet-UseTextForParameters' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs#L29-L37' title='Snippet source file'>snippet source</a> | <a href='#snippet-UseTextForParametersFluentNunit' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down Expand Up @@ -168,7 +179,7 @@ public Task IgnoreParametersForVerified(string arg)
return Verify("value", settings);
}
```
<sup><a href='/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs#L47-L58' title='Snippet source file'>snippet source</a> | <a href='#snippet-IgnoreParametersForVerifiedNunit' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs#L51-L62' title='Snippet source file'>snippet source</a> | <a href='#snippet-IgnoreParametersForVerifiedNunit' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -183,7 +194,7 @@ public Task IgnoreParametersForVerifiedFluent(string arg) =>
Verify("value")
.IgnoreParametersForVerified();
```
<sup><a href='/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs#L60-L68' title='Snippet source file'>snippet source</a> | <a href='#snippet-IgnoreParametersForVerifiedFluentNunit' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs#L64-L72' title='Snippet source file'>snippet source</a> | <a href='#snippet-IgnoreParametersForVerifiedFluentNunit' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -206,7 +217,7 @@ public Task IgnoreParametersForVerifiedCustomParams(string arg)
return Verify("value", settings);
}
```
<sup><a href='/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs#L70-L81' title='Snippet source file'>snippet source</a> | <a href='#snippet-IgnoreParametersForVerifiedCustomParamsNunit' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs#L74-L85' title='Snippet source file'>snippet source</a> | <a href='#snippet-IgnoreParametersForVerifiedCustomParamsNunit' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand All @@ -221,7 +232,7 @@ public Task IgnoreParametersForVerifiedCustomParamsFluent(string arg) =>
Verify("value")
.IgnoreParametersForVerified($"Number{arg}");
```
<sup><a href='/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs#L83-L91' title='Snippet source file'>snippet source</a> | <a href='#snippet-IgnoreParametersForVerifiedCustomParamsFluentNunit' title='Start of snippet'>anchor</a></sup>
<sup><a href='/src/Verify.NUnit.Tests/Snippets/ParametersSample.cs#L87-L95' title='Snippet source file'>snippet source</a> | <a href='#snippet-IgnoreParametersForVerifiedCustomParamsFluentNunit' title='Start of snippet'>anchor</a></sup>
<!-- endSnippet -->


Expand Down
23 changes: 5 additions & 18 deletions src/Verify.NUnit.Tests/Snippets/ParametersSample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public Task Float(float arg) =>
public Task Double(double arg) =>
Verify(arg);

#region UseTextForParameters
#region UseTextForParametersInstanceNunit

[TestCase("Value1")]
[TestCase("Value2")]
Expand All @@ -24,6 +24,10 @@ public Task UseTextForParameters(string arg)
return Verify(arg + "UseTextForParameters", settings);
}

#endregion

#region UseTextForParametersFluentNunit

[TestCase("Value1")]
[TestCase("Value2")]
public Task UseTextForParametersFluent(string arg) =>
Expand Down Expand Up @@ -149,21 +153,4 @@ public Task TestCaseUsage(string arg) =>
public Task SuppliedDoesNotMatchArg(string arg) =>
Verify("Foo")
.UseParameters("notTheArg");

// #region nunitAutoFixture
//
// [Theory]
// [InlineAutoData(42)]
// public Task AutoFixtureUsage(int stable, string random1, string random2)
// {
// var result = MethodBeingTested(stable, random1, random2);
// return Verify(result)
// .UseParameters(stable);
// }
//
// #endregion
//
// // ReSharper disable UnusedParameter.Local
// static int MethodBeingTested(int stable, string random1, string random2) =>
// stable;
}

This file was deleted.

5 changes: 0 additions & 5 deletions src/Verify.NUnit.Tests/Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ public Task UseFileNameWithParam(string arg) =>
Verify(arg)
.UseFileName("UseFileNameWithParam");

[TestCase("Value1")]
public Task UseTextForParameters(string arg) =>
Verify(arg)
.UseTextForParameters("TextForParameter");

[TestCase("Value1", TestName = "CustomName")]
public Task TestCaseWithName(string arg) =>
Verify(arg);
Expand Down

0 comments on commit 6563ee3

Please sign in to comment.