Ejemplo n.º 1
0
 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"));
     });
 }
Ejemplo n.º 2
0
    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
    }
Ejemplo n.º 3
0
 public static void Init()
 {
     VerifierSettings.DerivePathInfo(Expectations.Initialize);
 }
Ejemplo n.º 4
0
 public Task InvalidDirectory()
 {
     VerifierSettings.DerivePathInfo((_, _, _, _) => new PathInfo(Path.GetInvalidPathChars().First().ToString()));
     return(Assert.ThrowsAsync <ArgumentException>(() => Verifier.Verify("Value")));
 }
Ejemplo n.º 5
0
 public Task InvalidType()
 {
     VerifierSettings.DerivePathInfo((_, _, _, _) => new PathInfo(null, Path.GetInvalidFileNameChars().First().ToString()));
     return(Assert.ThrowsAsync <ArgumentException>(() => Verifier.Verify("Value")));
 }
Ejemplo n.º 6
0
 public Task ReturnNulls()
 {
     VerifierSettings.DerivePathInfo((_, _, _, _) => new PathInfo(null));
     return(Verifier.Verify("Value"));
 }