예제 #1
0
        public void CheckExtensions_IniFileMissing()
        {
            using (var tempRepo = new TemporaryFolder("CheckExtensions_IniFileMissing"))
            {
                // remember original value of Mercurial directory
                var pathToMercurialFolder = MercurialLocation.PathToMercurialFolder;
                // then set a dummy location that we can modify
                File.WriteAllText(Path.Combine(tempRepo.Path, Platform.IsWindows ? "hg.exe" : "hg"), string.Empty);
                MercurialLocation.PathToMercurialFolder = tempRepo.Path;

                var doc = HgRepository.GetMercurialConfigInMercurialFolder();
                var extensionsRequiredInIni = HgRepository.HgExtensions;

                Assert.That(HgRepository.CheckExtensions(doc, extensionsRequiredInIni), Is.False);
            }
        }