コード例 #1
0
 public void Finds_GitDirectory()
 {
     try
     {
         VersionAndBranchFinder.GetVersion(workDirectory, null, true, null);
     }
     catch (Exception ex)
     {
         // `RepositoryNotFoundException` means that it couldn't find the .git directory,
         // any other exception means that the .git was found but there was some other issue that this test doesn't care about.
         Assert.IsNotAssignableFrom <RepositoryNotFoundException>(ex);
     }
 }
コード例 #2
0
    public void Finds_GitDirectory_In_Parent()
    {
        var childDir = Path.Combine(workDirectory, "child");

        Directory.CreateDirectory(childDir);

        try
        {
            VersionAndBranchFinder.GetVersion(childDir, null, true, null);
        }
        catch (Exception ex)
        {
            // `RepositoryNotFoundException` means that it couldn't find the .git directory,
            // any other exception means that the .git was found but there was some other issue that this test doesn't care about.
            Assert.IsNotAssignableFrom <RepositoryNotFoundException>(ex);
        }
    }