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


C# RepositorySetup.AddAndCheckIn方法代码示例

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


在下文中一共展示了RepositorySetup.AddAndCheckIn方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: AddUtf8FileName_CloneUpdatedFileExists

        public void AddUtf8FileName_CloneUpdatedFileExists()
        {
            using (var setup = new RepositorySetup("Dan"))
            {
                const string utf8FilePath = "açesbsun.wav";
                setup.ChangeFile(utf8FilePath, "hello");
                setup.ProjectFolderConfig.IncludePatterns.Add("*.wav");
                setup.AddAndCheckIn();

                using (var other = new RepositorySetup("Bob", setup))
                {
                    other.AssertFileExists(utf8FilePath);
                }

            }
        }
开发者ID:regnrand,项目名称:chorus,代码行数:16,代码来源:Utf8Tests.cs

示例4: ChangedUtf8File_FileCanBePulledAndUpdated

        public void ChangedUtf8File_FileCanBePulledAndUpdated()
        {
            using (var setup = new RepositorySetup("Dan"))
            {
                const string utf8FilePath = "açesbsun.wav";
                setup.ChangeFile(utf8FilePath, "hello1");
                setup.ProjectFolderConfig.IncludePatterns.Add("*.wav");
                setup.AddAndCheckIn();

                using (var other = new RepositorySetup("Bob", setup))
                {
                    setup.ChangeFile(utf8FilePath, "hello2");
                    setup.Repository.Commit(false, "update");
                    other.CheckinAndPullAndMerge(setup); // Fix: Currently this modifies Dan adding bogus file unexpectedly.
                    other.AssertFileExists(utf8FilePath);
                    string[] fileNames = Directory.GetFiles(other.ProjectFolder.Path, "*.wav");
                    Assert.AreEqual(1, fileNames.Length);
                }

            }
        }
开发者ID:regnrand,项目名称:chorus,代码行数:21,代码来源:Utf8Tests.cs

示例5: EnsureRepoIdIsCorrect

        public void EnsureRepoIdIsCorrect()
        {
            using (var setup = new RepositorySetup("Dan"))
            {
                var id = setup.Repository.Identifier;
                Assert.IsTrue(String.IsNullOrEmpty(id));

                var path = setup.ProjectFolder.Combine("test.1w1");
                File.WriteAllText(path, "hello");
                setup.ProjectFolderConfig.IncludePatterns.Clear();
                setup.ProjectFolderConfig.ExcludePatterns.Clear();
                setup.ProjectFolderConfig.IncludePatterns.Add("*.1w1");
                setup.AddAndCheckIn(); // Need to have one commit.

                id = setup.Repository.Identifier;
                Assert.IsFalse(String.IsNullOrEmpty(id));

                var results = HgRunner.Run("log -r0 --template " + "\"{node}\"", setup.Repository.PathToRepo, 10, setup.Progress);
                // This will probably fail, if some other version of Hg is used,
                // as it may include multiple lines (complaining about deprecated extension Chorus uses),
                // where the last one will be the id.
                Assert.AreEqual(results.StandardOutput.Trim(), id);
            }
        }
开发者ID:regnrand,项目名称:chorus,代码行数:24,代码来源:HgWrappingTests.cs

示例6: Utf8ExtensionPresent_LocalMercurialIniIncorrect_MercurialOpStillWorks

        public void Utf8ExtensionPresent_LocalMercurialIniIncorrect_MercurialOpStillWorks()
        {
            using (new MercurialIniHider())
            using (var setup = new RepositorySetup("Dan"))
            {
                const string utf8FilePath = "açesbsun.wav";
                setup.ChangeFile(utf8FilePath, "hello1");
                setup.ProjectFolderConfig.IncludePatterns.Add("*.wav");
                setup.AddAndCheckIn();

                setup.AssertFileExistsInRepository("açesbsun.wav");

            }
        }
开发者ID:regnrand,项目名称:chorus,代码行数:14,代码来源:Utf8Tests.cs

示例7: Utf8ExtensionPresent_CloneLocalWithUpdateDoesNotHaveBogusFiles

        public void Utf8ExtensionPresent_CloneLocalWithUpdateDoesNotHaveBogusFiles()
        {
            using (var setup = new RepositorySetup("Dan"))
            {
                const string utf8FilePath = "açesbsun.wav";
                setup.ChangeFile(utf8FilePath, "hello1");
                setup.ProjectFolderConfig.IncludePatterns.Add("*.wav");
                setup.AddAndCheckIn();

                using (var other = new RepositorySetup("Bob", false))
                {
                    setup.Repository.CloneLocalWithoutUpdate(other.ProjectFolder.Path); // Somewhat surprisingly this works as it is using the settings of the source hgrc during the clone
                    other.Repository.Update();

                    other.AssertFileExists(utf8FilePath);
                    string[] fileNames = Directory.GetFiles(other.ProjectFolder.Path, "*.wav");
                    Assert.AreEqual(1, fileNames.Length);

                    //Assert.IsTrue(setup.GetProgressString().Contains());
                }

            }
        }
开发者ID:regnrand,项目名称:chorus,代码行数:23,代码来源:Utf8Tests.cs

示例8: Utf8ExtensionPresent_CloneDoesNotHaveBogusFiles

        public void Utf8ExtensionPresent_CloneDoesNotHaveBogusFiles()
        {
            using (var setup = new RepositorySetup("Dan"))
            {
                const string utf8FilePath = "açesbsun.wav";
                setup.ChangeFile(utf8FilePath, "hello1");
                setup.ProjectFolderConfig.IncludePatterns.Add("*.wav");
                setup.AddAndCheckIn();

                using (var other = new RepositorySetup("Bob", false))
                {
                    //var uri = new Uri(String.Format("file:///{0}", setup.ProjectFolder.Path));
                    HgRepository.Clone(new HttpRepositoryPath("utf test repo", setup.ProjectFolder.Path, false), other.ProjectFolder.Path, other.Progress);
                    other.Repository.Update();

                    other.AssertFileExists(utf8FilePath);
                    string[] fileNames = Directory.GetFiles(other.ProjectFolder.Path, "*.wav");
                    Assert.AreEqual(1, fileNames.Length);

                    //Assert.IsTrue(setup.GetProgressString().Contains());
                }

            }
        }
开发者ID:regnrand,项目名称:chorus,代码行数:24,代码来源:Utf8Tests.cs

示例9: MakeListItemWhenRepoInUse_MakesDisabledItem

        public void MakeListItemWhenRepoInUse_MakesDisabledItem()
        {
            using (var setup = new RepositorySetup("Dan"))
            {
                // Set a project up sufficiently to have an ID.
                var tempFilePath = setup.ProjectFolder.Combine("test.1w1");
                File.WriteAllText(tempFilePath, "hello");
                setup.ProjectFolderConfig.IncludePatterns.Clear();
                setup.ProjectFolderConfig.ExcludePatterns.Clear();
                setup.ProjectFolderConfig.IncludePatterns.Add("*.1w1");
                setup.AddAndCheckIn(); // Need to have one commit.
                var id = setup.Repository.Identifier;
                var path = setup.Repository.PathToRepo;

                var model = new CloneFromUsb();
                model.ReposInUse = new Dictionary<string, string>();
                model.ReposInUse[id] = "myname";
                var item = model.CreateListItemFor(path);
                Assert.That(item, Is.Not.Null, "model should have made a list item");
                Assert.That(item.Text, Is.EqualTo(Path.GetFileName(path)));
                Assert.That(item.Tag, Is.EqualTo(path));
                var last = File.GetLastWriteTime(path);
                string expectedSubitem = last.ToShortDateString() + " " + last.ToShortTimeString();
                // Not a great test, basically duplicates the impl
                Assert.That(item.SubItems[1].Text, Is.EqualTo(expectedSubitem));
                Assert.That(item.ToolTipText, Is.EqualTo(string.Format(CloneFromUsb.ProjectInUseTemplate, "myname")));
                Assert.That(item.ImageIndex, Is.EqualTo(1));
                Assert.That(item.ForeColor, Is.EqualTo(CloneFromUsb.DisabledItemForeColor));
            }
        }
开发者ID:JessieGriffin,项目名称:chorus,代码行数:30,代码来源:ClonerTests.cs

示例10: IncludeFilesInSubFolders

        public void IncludeFilesInSubFolders()
        {
            using (var setup = new RepositorySetup("Dan"))
            {
                var subpictures = setup.ProjectFolder.Combine("pictures", "subpictures");
                Directory.CreateDirectory(subpictures);
                var goodpicture = setup.ProjectFolder.Combine(subpictures, "good.picture");
                File.WriteAllText(goodpicture, "hello"); // Not a real jpeg file

                var subaudio = setup.ProjectFolder.Combine("audio", "subaudio");
                Directory.CreateDirectory(subaudio);
                var goodaudio = setup.ProjectFolder.Combine(subaudio, "good.audio");
                File.WriteAllText(goodaudio, "hello"); // Not a real mp3 file

                var subothers = setup.ProjectFolder.Combine("others", "subothers");
                Directory.CreateDirectory(subothers);
                var goodother = setup.ProjectFolder.Combine(subothers, "good.other");
                File.WriteAllText(goodother, "hello");

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

                LiftFolder.AddLiftFileInfoToFolderConfiguration(setup.ProjectFolderConfig);

                setup.AddAndCheckIn();
                setup.AssertFileExistsInRepository("pictures/subpictures/good.picture");
                setup.AssertFileExistsInRepository("audio/subaudio/good.audio");
                setup.AssertFileExistsInRepository("others/subothers/good.other");
            }
        }
开发者ID:regnrand,项目名称:chorus,代码行数:30,代码来源:IncludeExcludeTests.cs

示例11: WavFileInRepoEvenWhenExcluded

 public void WavFileInRepoEvenWhenExcluded()
 {
     using (var setup = new RepositorySetup("Dan"))
     {
         var path = setup.ProjectFolder.Combine("test.wav");
         File.WriteAllText(path, "hello");
         setup.ProjectFolderConfig.IncludePatterns.Clear();
         setup.ProjectFolderConfig.IncludePatterns.Add("*.*");
         setup.ProjectFolderConfig.ExcludePatterns.Clear();
         setup.ProjectFolderConfig.ExcludePatterns.Add("test.wav");
         setup.AddAndCheckIn();
         // TODO: If Hg is fixed to exclude "wav" files,
         // revise this test to assert it is *not* in repo.
         // Very important: Also fix the "wav" extension hacks in LargeFileFilter AND AudioFileTypeHandlerTests
         setup.AssertFileExistsInRepository("test.wav");
     }
 }
开发者ID:regnrand,项目名称:chorus,代码行数:17,代码来源:IncludeExcludeTests.cs

示例12: StarDotExtensionPatternSpecified_FileAdded

 public void StarDotExtensionPatternSpecified_FileAdded()
 {
     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("*.1w1");
         setup.ProjectFolderConfig.ExcludePatterns.Clear();
         setup.AddAndCheckIn();
         setup.AssertFileExistsInRepository("test.1w1");
     }
 }
开发者ID:regnrand,项目名称:chorus,代码行数:13,代码来源:IncludeExcludeTests.cs

示例13: 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

示例14: Utf8ExtensionNotPresent_CloneLocalWithoutUpdateThrows

        #if !MONO

        [Test]
        public void Utf8ExtensionNotPresent_CloneLocalWithoutUpdateThrows()
        {
            using (var setup = new RepositorySetup("Dan"))
            {
                const string utf8FilePath = "açesbsun.wav";
                setup.ChangeFile(utf8FilePath, "hello1");
                setup.ProjectFolderConfig.IncludePatterns.Add("*.wav");
                setup.AddAndCheckIn();

                using (new MercurialExtensionHider())
                using (var other = new RepositorySetup("Bob", false))
                {
                    Assert.Throws<ApplicationException>(
                        () => setup.Repository.CloneLocalWithoutUpdate(other.ProjectFolder.Path)
                    );
                    //string log = setup.GetProgressString();
                    //Assert.That(log, Contains.Substring("Failed to set up extensions"));
                    //Assert.IsTrue(setup.GetProgressString().Contains());
                }
开发者ID:JessieGriffin,项目名称:chorus,代码行数:22,代码来源:Utf8Tests.cs


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