static Tests() { VerifierSettings.DerivePathInfo( (sourceFile, projectDirectory, type, method) => { Assert.True(File.Exists(sourceFile)); Assert.True(Directory.Exists(projectDirectory)); Assert.NotNull(method); Assert.NotNull(type); Assert.EndsWith("Verify.DerivePaths.Tests/Tests.cs", sourceFile.Replace(@"\", "/")); Assert.EndsWith("Verify.DerivePaths.Tests/", projectDirectory.Replace(@"\", "/")); return(new PathInfo("CustomDir", "CustomTypeName", "CustomMethodName")); }); }
void DerivePathInfo() { #region DerivePathInfo VerifierSettings.DerivePathInfo( (sourceFile, projectDirectory, type, method) => { return(new PathInfo( directory: Path.Combine(projectDirectory, "Snapshots"), typeName: type.Name, methodName: method.Name)); }); #endregion }
public static void Init() { VerifierSettings.DerivePathInfo(Expectations.Initialize); }
public Task InvalidDirectory() { VerifierSettings.DerivePathInfo((_, _, _, _) => new PathInfo(Path.GetInvalidPathChars().First().ToString())); return(Assert.ThrowsAsync <ArgumentException>(() => Verifier.Verify("Value"))); }
public Task InvalidType() { VerifierSettings.DerivePathInfo((_, _, _, _) => new PathInfo(null, Path.GetInvalidFileNameChars().First().ToString())); return(Assert.ThrowsAsync <ArgumentException>(() => Verifier.Verify("Value"))); }
public Task ReturnNulls() { VerifierSettings.DerivePathInfo((_, _, _, _) => new PathInfo(null)); return(Verifier.Verify("Value")); }