From 58ab3ef59195a5fccfb69d0968b67fd4354e2d48 Mon Sep 17 00:00:00 2001 From: Simon Cropp Date: Thu, 5 Sep 2024 07:56:00 +1000 Subject: [PATCH] docs --- docs/mdsource/parameterised.source.md | 19 +++++++++++-------- docs/parameterised.md | 19 +++++++++++-------- src/Verify/Naming/ParameterSettings.cs | 2 +- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/docs/mdsource/parameterised.source.md b/docs/mdsource/parameterised.source.md index 7984c6857e..7a7b64add4 100644 --- a/docs/mdsource/parameterised.source.md +++ b/docs/mdsource/parameterised.source.md @@ -20,16 +20,19 @@ Characters that cannot be used for a file name are replaced with a dash (`-`). ## UseParameters() - +`UseParameters`() is used to control what parameters are used when naming files. The usage depends on the test framework being used: + * Verify.Expecto: Does not currently support `UseParameters()`. * 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.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. - -`UseParameters`() is used to control what parameters are used when naming files. The usual usage is to pass though all parameters (in the same order) that the test method accepts: + +### Usage: + +For the above scenarios where parameters are not automatically detected: snippet: UseParameters @@ -42,7 +45,7 @@ If the number of parameters passed to `UseParameters()` is greater than the numb ## NUnit -`Verify.NUnit` automatically detects the method parameters. So `UseParameters()` is not required unless using custom parameters. +`Verify.NUnit` automatically detects the method parameters. So `UseParameters()` is not required unless using custom parameters. ### TestCase @@ -64,7 +67,7 @@ Produces: ## xUnit V2 -`Verify.Xunit` does not detect the parametrized arguments, as such `UseParameters()` is required. +`Verify.Xunit` does not detect the parametrized arguments, as such `UseParameters()` is required. ### InlineData @@ -88,7 +91,7 @@ snippet: xunitComplexMemberData ## xUnit V3 -`Verify.XunitV3` automatically detect the method parameters for built in types (string, int, bool etc), but for complex types `UseParameters()` is required. +`Verify.XunitV3` automatically detect the method parameters for built in types (string, int, bool etc), but for complex types `UseParameters()` is required. ### InlineData @@ -112,7 +115,7 @@ snippet: xunitV3ComplexMemberData ## Fixie -Fixie has no build in test parameterisation. Test parameterisation need to be implemented by the consuming library. See [Attribute-Based Parameterization](https://github.com/fixie/fixie/wiki/Customizing-the-Test-Project-Lifecycle#recipe-attribute-based-parameterization) for an example. +Fixie has no build in test parameterisation. Test parameterisation need to be implemented by the consuming library. See [Attribute-Based Parameterization](https://github.com/fixie/fixie/wiki/Customizing-the-Test-Project-Lifecycle#recipe-attribute-based-parameterization) for an example. Verify.Fixie requires some customisation of the above example. @@ -130,7 +133,7 @@ snippet: FixieTestCase ## MSTest -`Verify.MSTest` does not detect the parametrized arguments, as such `UseParameters()` is required. +`Verify.MSTest` does not detect the parametrized arguments, as such `UseParameters()` is required. ### DataRow diff --git a/docs/parameterised.md b/docs/parameterised.md index 2479ffbfe0..c2f845ecbc 100644 --- a/docs/parameterised.md +++ b/docs/parameterised.md @@ -27,16 +27,19 @@ Characters that cannot be used for a file name are replaced with a dash (`-`). ## UseParameters() - +`UseParameters`() is used to control what parameters are used when naming files. The usage depends on the test framework being used: + * Verify.Expecto: Does not currently support `UseParameters()`. * 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.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. - -`UseParameters`() is used to control what parameters are used when naming files. The usual usage is to pass though all parameters (in the same order) that the test method accepts: + +### Usage: + +For the above scenarios where parameters are not automatically detected: @@ -76,7 +79,7 @@ If the number of parameters passed to `UseParameters()` is greater than the numb ## NUnit -`Verify.NUnit` automatically detects the method parameters. So `UseParameters()` is not required unless using custom parameters. +`Verify.NUnit` automatically detects the method parameters. So `UseParameters()` is not required unless using custom parameters. ### TestCase @@ -138,7 +141,7 @@ Produces: ## xUnit V2 -`Verify.Xunit` does not detect the parametrized arguments, as such `UseParameters()` is required. +`Verify.Xunit` does not detect the parametrized arguments, as such `UseParameters()` is required. ### InlineData @@ -310,7 +313,7 @@ public class ComplexParametersSample ## xUnit V3 -`Verify.XunitV3` automatically detect the method parameters for built in types (string, int, bool etc), but for complex types `UseParameters()` is required. +`Verify.XunitV3` automatically detect the method parameters for built in types (string, int, bool etc), but for complex types `UseParameters()` is required. ### InlineData @@ -461,7 +464,7 @@ public class ComplexParametersSample ## Fixie -Fixie has no build in test parameterisation. Test parameterisation need to be implemented by the consuming library. See [Attribute-Based Parameterization](https://github.com/fixie/fixie/wiki/Customizing-the-Test-Project-Lifecycle#recipe-attribute-based-parameterization) for an example. +Fixie has no build in test parameterisation. Test parameterisation need to be implemented by the consuming library. See [Attribute-Based Parameterization](https://github.com/fixie/fixie/wiki/Customizing-the-Test-Project-Lifecycle#recipe-attribute-based-parameterization) for an example. Verify.Fixie requires some customisation of the above example. @@ -532,7 +535,7 @@ public Task TestCaseUsage(string arg) => ## MSTest -`Verify.MSTest` does not detect the parametrized arguments, as such `UseParameters()` is required. +`Verify.MSTest` does not detect the parametrized arguments, as such `UseParameters()` is required. ### DataRow diff --git a/src/Verify/Naming/ParameterSettings.cs b/src/Verify/Naming/ParameterSettings.cs index e6c052ea4e..5179a1d7f5 100644 --- a/src/Verify/Naming/ParameterSettings.cs +++ b/src/Verify/Naming/ParameterSettings.cs @@ -43,7 +43,7 @@ public void UseParameters(T parameter) => /// Verify.Expecto: Does not currently support `UseParameters()`. /// Verify.Fixie: Automatically detects the method parameters via a custom ITestProject https://github.com/VerifyTests/Verify/blob/main/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.NUnit: 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 types `UseParameters()` is required. ///