public InnerVerifier(string sourceFile, Type type, VerifySettings settings, MethodInfo method, IReadOnlyList <object?>?parameters) { var(projectDirectory, replacements) = AttributeReader.GetAssemblyInfo(type.Assembly); settings.instanceScrubbers.Add(replacements); fileNameBuilder = new FileNameBuilder(method, type, projectDirectory, sourceFile, parameters, settings); this.settings = settings; CounterContext.Start(); }
public InnerVerifier(string sourceFile, Type type, VerifySettings settings, MethodInfo method) { var(projectDirectory, replacements) = AttributeReader.GetAssemblyInfo(type.Assembly); settings.instanceScrubbers.Add(replacements); fileNameBuilder = new(method, type, projectDirectory, sourceFile, settings); this.settings = settings; VerifierSettings.RunBeforeCallbacks(); }
public InnerVerifier(string testName, string sourceFile, Assembly assembly, VerifySettings settings) { var projectDirectory = AttributeReader.GetProjectDirectory(assembly); directory = VerifierSettings.DeriveDirectory(sourceFile, projectDirectory); this.testName = testName; this.assembly = assembly; this.settings = settings; var altProjectDirectory = projectDirectory.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); var altProjectDirectoryTrimmed = altProjectDirectory.TrimEnd('/', '\\'); var projectDirectoryTrimmed = projectDirectory.TrimEnd('/', '\\'); settings.instanceScrubbers.Add(builder => { builder.Replace(projectDirectory, "{ProjectDirectory}"); builder.Replace(projectDirectoryTrimmed, "{ProjectDirectory}"); builder.Replace(altProjectDirectory, "{ProjectDirectory}"); builder.Replace(altProjectDirectoryTrimmed, "{ProjectDirectory}"); }); if (AttributeReader.TryGetSolutionDirectory(assembly, out var solutionDirectory)) { var altSolutionDirectory = solutionDirectory !.Replace(Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar); var altSolutionDirectoryTrimmed = altSolutionDirectory.TrimEnd('/', '\\'); var solutionDirectoryTrimmed = solutionDirectory.TrimEnd('/', '\\'); settings.instanceScrubbers.Add(builder => { builder.Replace(solutionDirectory, "{SolutionDirectory}"); builder.Replace(solutionDirectoryTrimmed, "{SolutionDirectory}"); builder.Replace(altSolutionDirectory, "{SolutionDirectory}"); builder.Replace(altSolutionDirectoryTrimmed, "{SolutionDirectory}"); }); } CounterContext.Start(); }