Skip to content

Commit

Permalink
Class level params test (#1245)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Jul 16, 2024
1 parent 8720929 commit fb0e907
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 4 deletions.
12 changes: 9 additions & 3 deletions src/Verify.ExceptionParsing/FilePair.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
namespace VerifyTests.ExceptionParsing;

[DebuggerDisplay("Received = {Received} | Verified = {Verified}")]
public readonly struct FilePair(string received, string verified)
public readonly struct FilePair
{
public string Received { get; } = received;
public string Verified { get; } = verified;
public FilePair(string received, string verified)
{
Received = received;
Verified = verified;
}

public string Received { get; }
public string Verified { get; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Value
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Value
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Value
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

8 changes: 7 additions & 1 deletion src/Verify.NUnit.Tests/Snippets/ClassLevelParams.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,11 @@ public class ClassLevelParams(string arg1)

[TestCase("3")]
[TestCase("4")]
public Task WithMethodLeve(string arg2) => Verify("Value");
public Task WithMethodLevel(string arg2) => Verify("Value");

[TestCase("3")]
[TestCase("4")]
public Task IgnoreParameters(string arg2) =>
Verify("Value")
.IgnoreParametersForVerified();
}
1 change: 1 addition & 0 deletions src/Verify.NUnit/Verifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ static InnerVerifier BuildVerifier(string sourceFile, VerifySettings settings, b
var customName = !adapter.FullName.StartsWith($"{testMethod.TypeInfo.FullName}.{testMethod.Name}");
if (customName)
{

settings.typeName ??= adapter.GetTypeName();

settings.methodName ??= adapter.GetMethodName();
Expand Down

0 comments on commit fb0e907

Please sign in to comment.