当前位置: 首页>>代码示例>>C#>>正文


C# RepositorySetup.AssertFileDoesNotExistInRepository方法代码示例

本文整理汇总了C#中LibChorus.TestUtilities.RepositorySetup.AssertFileDoesNotExistInRepository方法的典型用法代码示例。如果您正苦于以下问题:C# RepositorySetup.AssertFileDoesNotExistInRepository方法的具体用法?C# RepositorySetup.AssertFileDoesNotExistInRepository怎么用?C# RepositorySetup.AssertFileDoesNotExistInRepository使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LibChorus.TestUtilities.RepositorySetup的用法示例。


在下文中一共展示了RepositorySetup.AssertFileDoesNotExistInRepository方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ExcludedVideosFileNotAdded

        public void ExcludedVideosFileNotAdded()
        {
            using (var setup = new RepositorySetup("Dan"))
            {
                var atRoot = setup.ProjectFolder.Combine("first.wmv");
                File.WriteAllText(atRoot, "hello");

                var pictures = setup.ProjectFolder.Combine("pictures");
                Directory.CreateDirectory(pictures);
                var videoExtensions = ProjectFolderConfiguration.VideoExtensions.ToList();
                foreach (var videoExtension in videoExtensions)
                {
                    var bad = Path.Combine(pictures, "nested." + videoExtension);
                    File.WriteAllText(bad, "hello");
                }

                setup.ProjectFolderConfig.ExcludePatterns.Clear();
                setup.ProjectFolderConfig.IncludePatterns.Clear();

                LiftFolder.AddLiftFileInfoToFolderConfiguration(setup.ProjectFolderConfig);

                setup.AddAndCheckIn();
                setup.AssertFileDoesNotExistInRepository("first.wmv");
                foreach (var videoExtension in videoExtensions)
                    setup.AssertFileDoesNotExistInRepository("pictures/nested." + videoExtension);
            }
        }
开发者ID:regnrand,项目名称:chorus,代码行数:27,代码来源:IncludeExcludeTests.cs

示例2: IncludeAllButExcludeOne_FileNotAdded

 public void IncludeAllButExcludeOne_FileNotAdded()
 {
     using (var setup = new RepositorySetup("Dan"))
     {
         var path = setup.ProjectFolder.Combine("test.1w1");
         File.WriteAllText(path, "hello");
         setup.ProjectFolderConfig.IncludePatterns.Clear();
         setup.ProjectFolderConfig.IncludePatterns.Add("*.*");
         setup.ProjectFolderConfig.ExcludePatterns.Clear();
         setup.ProjectFolderConfig.ExcludePatterns.Add("*.1w1");
         setup.AddAndCheckIn();
         setup.AssertFileDoesNotExistInRepository("test.1w1");
     }
 }
开发者ID:regnrand,项目名称:chorus,代码行数:14,代码来源:IncludeExcludeTests.cs

示例3: InitialFileCommit_Invalid_BacksOut

 public void InitialFileCommit_Invalid_BacksOut()
 {
     using(var bob = new RepositorySetup("bob"))
     {
         bob.AddAndCheckinFile("validfile.chorustest", "valid contents");
         bob.ChangeFile("test.chorusTest", ChorusTestFileHandler.GetInvalidContents());
         using(var cop = new CommitCop(bob.Repository, ChorusFileTypeHandlerCollection.CreateWithTestHandlerOnly(), bob.Progress))
         {
             bob.Repository.AddAndCheckinFile("test.chorusTest");
             Assert.That(cop.ValidationResult, Is.StringContaining("Failed"));
         }
         Debug.WriteLine(bob.Repository.GetLog(-1));
         bob.AssertHeadCount(1);
         bob.AssertLocalRevisionNumber(2);
         bob.AssertFileDoesNotExistInRepository("test.chorusTest");
         bob.AssertFileExistsInRepository("validfile.chorustest");
     }
 }
开发者ID:regnrand,项目名称:chorus,代码行数:18,代码来源:CommitCopTests.cs

示例4: LongWavFileIsFilteredOutAndNotInRepo

        public void LongWavFileIsFilteredOutAndNotInRepo()
        {
            using (var bob = new RepositorySetup("bob"))
            {
                var megabyteLongData = "long" + Environment.NewLine;
                while (megabyteLongData.Length < LargeFileFilter.Megabyte)
                    megabyteLongData += megabyteLongData;

                const string fileName = "big.wav";
                bob.ChangeFile(fileName, megabyteLongData);
                var fullPathname = Path.Combine(bob.ProjectFolderConfig.FolderPath, fileName);
                var pathToRepo = bob.Repository.PathToRepo + Path.DirectorySeparatorChar;
                bob.Repository.TestOnlyAddSansCommit(fullPathname);
                var config = bob.ProjectFolderConfig;
                config.ExcludePatterns.Clear();
                config.IncludePatterns.Clear();
                config.IncludePatterns.Add("**.wav");

                var result = LargeFileFilter.FilterFiles(
                    bob.Repository,
                    config,
                    ChorusFileTypeHandlerCollection.CreateWithInstalledHandlers());
                Assert.IsFalse(string.IsNullOrEmpty(result));
                var shortpath = fullPathname.Replace(pathToRepo, "");
                Assert.IsTrue(config.ExcludePatterns.Contains(shortpath));
                Assert.IsFalse(config.IncludePatterns.Contains(shortpath));
                bob.Repository.AddAndCheckinFiles(config.IncludePatterns, config.ExcludePatterns, "Some commit");
                bob.AssertFileDoesNotExistInRepository("big.wav");
            }
        }
开发者ID:JessieGriffin,项目名称:chorus,代码行数:30,代码来源:LargeFileFilterTests.cs

示例5: IncludeInGeneralButExcludeInSubfolder_FileNotAdded

        public void IncludeInGeneralButExcludeInSubfolder_FileNotAdded()
        {
            using (var setup = new RepositorySetup("Dan"))
            {
                var good = setup.ProjectFolder.Combine("good.lift");
                File.WriteAllText(good, "hello");

                var export = setup.ProjectFolder.Combine("export");
                Directory.CreateDirectory(export);
                var bad = Path.Combine(export, "bad.lift");
                File.WriteAllText(bad, "hello");

                var goodFontCss = Path.Combine(export, "customFonts.css");
                File.WriteAllText(goodFontCss, "hello");

                var goodLayoutCss = Path.Combine(export, "customLayout.css");
                File.WriteAllText(goodLayoutCss, "hello");

                var other = setup.ProjectFolder.Combine("other");
                Directory.CreateDirectory(other);
                var otherBad = Path.Combine(export, "otherBad.lift");
                File.WriteAllText(otherBad, "hello");

                setup.ProjectFolderConfig.ExcludePatterns.Clear();
                setup.ProjectFolderConfig.IncludePatterns.Clear();

                LiftFolder.AddLiftFileInfoToFolderConfiguration(setup.ProjectFolderConfig);

                setup.AddAndCheckIn();
                setup.AssertFileExistsInRepository("good.lift");
                setup.AssertFileExistsInRepository("export/customFonts.css");
                setup.AssertFileExistsInRepository("export/customLayout.css");
                setup.AssertFileDoesNotExistInRepository("export/bad.lift");
                setup.AssertFileDoesNotExistInRepository("other/otherBad.lift");
            }
        }
开发者ID:regnrand,项目名称:chorus,代码行数:36,代码来源:IncludeExcludeTests.cs


注:本文中的LibChorus.TestUtilities.RepositorySetup.AssertFileDoesNotExistInRepository方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。