Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Sep 4, 2024
1 parent 6bbb0de commit 6032c96
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 45 deletions.
50 changes: 11 additions & 39 deletions src/Verify/Naming/ParameterSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,65 +18,37 @@ public bool TryGetParameters([NotNullWhen(true)] out object?[]? parameters)

public bool HasParameters => parameters != null;

/// <summary>
/// Define the parameter values being used by a parameterised (aka data driven) test.
///
/// Scenarios:
///
/// * 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.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.
///
/// When this is not possible, an exception will be thrown instructing the use of <see cref="UseParameters" />
/// Not compatible with <see cref="UseTextForParameters" />.
/// </summary>
/// <inheritdoc cref="UseParameters(object?[])"/>
public void UseParameters<T>(T[] parameters) =>
UseParameters(
new object?[]
{
parameters
});


/// <summary>
/// Define the parameter values being used by a parameterised (aka data driven) test.
///
/// Scenarios:
///
/// * 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.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.
///
/// When this is not possible, an exception will be thrown instructing the use of <see cref="UseParameters" />
/// Not compatible with <see cref="UseTextForParameters" />.
/// </summary>
/// <inheritdoc cref="UseParameters(object?[])"/>
public void UseParameters<T>(T parameter) =>
UseParameters(
new object?[]
{
parameter
});


/// <summary>
/// Define the parameter values being used by a parameterised (aka data driven) test.
///
/// Scenarios:
///
/// * 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.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.
/// <list type="bullet">
/// <item>Verify.Expecto: Does not currently support `UseParameters()`.</item>
/// <item>Verify.Fixie: Automatically detects the method parameters via a custom ITestProject https://github.com/VerifyTests/Verify/blob/main/docs/parameterised.md#fixie.</item>
/// <item>Verify.MSTest: Does not detect the parametrised arguments, as such `UseParameters()` is required..</item>
/// <item>Verify.NUnit: Automatically detects the method parameters. So `UseParameters()` is not required unless using custom parameters..</item>
/// <item>Verify.Xunit: Does not detect the parametrised arguments, as such `UseParameters()` is required.</item>
/// <item>Verify.XunitV3: Automatically detect the method parameters for built in types (string, int, bool etc), but for complex types `UseParameters()` is required.</item>
/// </list>
///
/// When this is not possible, an exception will be thrown instructing the use of <see cref="UseParameters" />
/// In the scenarios where parameters are not automatically detected, an exception will be thrown instructing the potential need for <see cref="UseParameters" />
/// Not compatible with <see cref="UseTextForParameters" />.
/// </summary>
public void UseParameters(params object?[] parameters)
Expand Down
9 changes: 3 additions & 6 deletions src/Verify/SettingsTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,23 @@ public SettingsTask IgnoreParametersForVerified(params object?[] parameters)
return this;
}

/// <summary>
/// Define the parameter values being used by a parameterised (aka data drive) test.
/// In most cases the parameter values can be automatically resolved.
/// When this is not possible, an exception will be thrown instructing the use of <see cref="UseParameters" />
/// Not compatible with <see cref="UseTextForParameters" />.
/// </summary>
/// <inheritdoc cref="VerifySettings.UseParameters(object?[])"/>
[Pure]
public SettingsTask UseParameters(params object?[] parameters)
{
CurrentSettings.UseParameters(parameters);
return this;
}

/// <inheritdoc cref="VerifySettings.UseParameters(object?[])"/>
[Pure]
public SettingsTask UseParameters<T>(T parameter)
{
CurrentSettings.UseParameters(parameter);
return this;
}

/// <inheritdoc cref="VerifySettings.UseParameters(object?[])"/>
[Pure]
public SettingsTask UseParameters<T>(T[] parameters)
{
Expand Down

0 comments on commit 6032c96

Please sign in to comment.