Skip to content

Project directory null when using UseParameters() and UseProjectRelativeDirectory() #2101

Open
@CCThorstenSauter

Description

@CCThorstenSauter

When upgrading both TUnit (v0.18.26v0.18.33) and Verify.TUnit (v28.15.0v28.16.0),
the following issue arises for tests using the UseParameters() method in conjunction with a [ModuleInitializer]
that changes the directory for snapshots using UseProjectRelativeDirectory():

ArgumentNullException: Value cannot be null. (Parameter 'path1')
   at System.ArgumentNullException.Throw(String paramName)
   at System.IO.Path.Combine(String path1, String path2)
   at VerifyTUnit.Verifier.<>c__DisplayClass3_0.<UseProjectRelativeDirectory>b__0(String sourceFile, String projectDirectory, Type type, MethodInfo method) in /_/src/Verify.TUnit/DerivePaths/Verifier.cs:line 29
   at VerifyTUnit.Verifier.GetPathInfo(String sourceFile, Type type, MethodInfo method) in /_/src/Verify.TUnit/DerivePaths/Verifier.cs:line 11
   at VerifyTUnit.Verifier.BuildVerifier(String sourceFile, VerifySettings settings, Boolean useUniqueDirectory) in /_/src/Verify.TUnit/Verifier.cs:line 46
   at VerifyTUnit.Verifier.<>c__DisplayClass8_0.<<Verify>b__0>d.MoveNext() in /_/src/Verify.TUnit/Verifier.cs:line 67

A reproducible example can be found in this repo on the project-directory-null branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions