public void Resolve_submodule_real_filesystem() { using GitModuleTestHelper helper = new(); var submodulePath = Path.Combine(helper.Module.WorkingDir, "External", "Git.hub"); helper.CreateFile(submodulePath, ".git", "\r \r\ngitdir: ../../.git/modules/Externals/Git.hub\r\ntext"); _resolver = new GitDirectoryResolver(); _resolver.Resolve(submodulePath).Should().Be($@"{helper.Module.WorkingDirGitDir}modules\Externals\Git.hub\"); _resolver.Resolve(helper.Module.WorkingDir).Should().Be(helper.Module.WorkingDirGitDir); }
public void Resolve_non_bare_repository_real_filsystem() { _resolver = new GitDirectoryResolver(); using (var helper = new GitModuleTestHelper()) { _resolver.Resolve(helper.Module.WorkingDir).Should().Be(helper.Module.WorkingDirGitDir); } }
public void Resolve_should_throw_if_path_is_null() { ((Action)(() => _resolver.Resolve(null))).Should().Throw <ArgumentNullException>(); }