本文整理汇总了C#中LibChorus.TestUtilities.RepositorySetup.CreateSynchronizer方法的典型用法代码示例。如果您正苦于以下问题:C# RepositorySetup.CreateSynchronizer方法的具体用法?C# RepositorySetup.CreateSynchronizer怎么用?C# RepositorySetup.CreateSynchronizer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibChorus.TestUtilities.RepositorySetup
的用法示例。
在下文中一共展示了RepositorySetup.CreateSynchronizer方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SettingSychronizerAdjunctToNullEndsWithDoNothingDefaultInterfaceImplementation
public void SettingSychronizerAdjunctToNullEndsWithDoNothingDefaultInterfaceImplementation()
{
using (var bob = new RepositorySetup("bob", true))
{
var synchronizer = bob.CreateSynchronizer();
Assert.IsNotNull(synchronizer.SynchronizerAdjunct);
Assert.IsInstanceOf<DefaultSychronizerAdjunct>(synchronizer.SynchronizerAdjunct);
synchronizer.SynchronizerAdjunct = null;
Assert.IsNotNull(synchronizer.SynchronizerAdjunct);
Assert.IsInstanceOf<DefaultSychronizerAdjunct>(synchronizer.SynchronizerAdjunct);
}
}
示例2: SynchNow_OnNamedBranchAndDefaultBranchExists_DoesNotMergeWithIt
public void SynchNow_OnNamedBranchAndDefaultBranchExists_DoesNotMergeWithIt()
{
using (var repo = new RepositorySetup("bob"))
{
if (repo.Synchronizer == null)
repo.Synchronizer = repo.CreateSynchronizer();
repo.Synchronizer.SynchronizerAdjunct = new ProgrammableSynchronizerAdjunct("default");
repo.AddAndCheckinFile("test.txt", "apple");
var afterFirstCheckin = repo.CreateBookmarkHere();
repo.ChangeFileAndCommit("test.txt", "pear", "second on default");
afterFirstCheckin.Go();
repo.Repository.BranchingHelper.Branch(new ConsoleProgress(), "animals");
repo.Synchronizer.SynchronizerAdjunct = new ProgrammableSynchronizerAdjunct("animals");
repo.ChangeFileAndCommit("test.txt", "dog", "first on animals");
var animalHead = repo.CreateBookmarkHere();
repo.AssertHeadCount(2);
repo.CheckinAndPullAndMerge();
repo.AssertHeadCount(2);
animalHead.AssertRepoIsAtThisPoint();
}
}
示例3: BasicCommitHasCommitFileButNotMergeFile
public void BasicCommitHasCommitFileButNotMergeFile()
{
using (var bob = new RepositorySetup("bob", true))
{
var syncAdjunct = new FileWriterSychronizerAdjunct(bob.RootFolder.Path);
CheckNoFilesExist(syncAdjunct);
var options = new SyncOptions
{
DoMergeWithOthers = false,
DoPullFromOthers = false,
DoSendToOthers = false
};
var synchronizer = bob.CreateSynchronizer();
synchronizer.SynchronizerAdjunct = syncAdjunct;
var syncResults = bob.SyncWithOptions(options, synchronizer);
Assert.IsFalse(syncResults.DidGetChangesFromOthers);
CheckExistanceOfAdjunctFiles(syncAdjunct, true, false, false, false, true, false);
}
}
示例4: SetUserNameInIni_SetsName
public void SetUserNameInIni_SetsName()
{
using (new MercurialIniForTests())
using (var setup = new RepositorySetup("Dan"))
{
setup.EnsureNoHgrcExists();
var repository = setup.CreateSynchronizer().Repository;
repository.SetUserNameInIni("bill", _progress);
Assert.AreEqual("bill", repository.GetUserNameFromIni(_progress, "anonymous"));
//this time, the hgrc does exist
repository.SetUserNameInIni("sue", _progress);
Assert.AreEqual("sue", repository.GetUserNameFromIni(_progress, "anonymous"));
}
}
示例5: SetTheOnlyAddressOfThisType_SettingLANPathHadSameType_IsReplacedByNew
public void SetTheOnlyAddressOfThisType_SettingLANPathHadSameType_IsReplacedByNew()
{
using (new MercurialIniForTests())
using (var setup = new RepositorySetup("Dan"))
{
setup.EnsureNoHgrcExists();
var repository = setup.CreateSynchronizer().Repository;
var x = RepositoryAddress.Create("theInterent", @"http://two.org");
var y1 = RepositoryAddress.Create("aPath1", @"\\someone1\someFolder");
repository.SetKnownRepositoryAddresses(new List<RepositoryAddress>(new RepositoryAddress[] { x, y1 }));
Assert.AreEqual(y1.URI, repository.GetRepositoryPathsInHgrc().ToArray()[1].URI, "Test setup is wrong");
var y2 = RepositoryAddress.Create("aPath2", @"\\someoneElse2\someOtherFolder");
repository.SetTheOnlyAddressOfThisType(y2);
Assert.AreEqual(2, repository.GetRepositoryPathsInHgrc().Count());
AssertHgrcNowContainsUri(repository, x.URI);
AssertHgrcNowContainsUri(repository, y2.URI);
}
}
示例6: SetTheOnlyAddressOfThisType_WasEmtpy_HasNewAddress
public void SetTheOnlyAddressOfThisType_WasEmtpy_HasNewAddress()
{
using (new MercurialIniForTests())
using (var setup = new RepositorySetup("Dan"))
{
setup.EnsureNoHgrcExists();
var repository = setup.CreateSynchronizer().Repository;
var y1 = RepositoryAddress.Create("aPath1", @"\\someone1\someFolder");
repository.SetTheOnlyAddressOfThisType(y1);
Assert.AreEqual(1, repository.GetRepositoryPathsInHgrc().Count());
Assert.AreEqual(y1.URI, repository.GetRepositoryPathsInHgrc().ToArray()[0].URI);
}
}
示例7: SetTheOnlyAddressOfThisType_HadAnotherType_HasOldAddressAndNew
public void SetTheOnlyAddressOfThisType_HadAnotherType_HasOldAddressAndNew()
{
using (new MercurialIniForTests())
using (var setup = new RepositorySetup("Dan"))
{
setup.EnsureNoHgrcExists();
var repository = setup.CreateSynchronizer().Repository;
var x = RepositoryAddress.Create("theInterent", @"http://two.org");
repository.SetKnownRepositoryAddresses(new List<RepositoryAddress>(new RepositoryAddress[] { x }));
var y2 = RepositoryAddress.Create("aPath2", @"\\someoneElse2\someOtherFolder");
repository.SetTheOnlyAddressOfThisType(y2);
Assert.AreEqual(2, repository.GetRepositoryPathsInHgrc().Count());
AssertHgrcNowContainsUri(repository, x.URI);
AssertHgrcNowContainsUri(repository, y2.URI);
}
}
示例8: SetTheOnlyAddressOfThisType_SettingInternetPathHadSameType_IsReplacedByNew
public void SetTheOnlyAddressOfThisType_SettingInternetPathHadSameType_IsReplacedByNew()
{
using (new MercurialIniForTests())
using (var setup = new RepositorySetup("Dan"))
{
setup.EnsureNoHgrcExists();
var repository = setup.CreateSynchronizer().Repository;
var x1 = RepositoryAddress.Create("interent1", @"http://one.org");
var y = RepositoryAddress.Create("aPath", @"\\someone1\someFolder");
repository.SetKnownRepositoryAddresses(new List<RepositoryAddress>(new RepositoryAddress[] { x1, y }));
Assert.AreEqual(x1.URI, repository.GetRepositoryPathsInHgrc().ToArray()[0].URI, "Test setup is wrong");
var x2 = RepositoryAddress.Create("internet2", @"http://two.org");
repository.SetTheOnlyAddressOfThisType(x2);
Assert.AreEqual(2, repository.GetRepositoryPathsInHgrc().Count());
AssertHgrcNowContainsUri(repository, y.URI);
AssertHgrcNowContainsUri(repository, x2.URI);
}
}
示例9: SetRepositoryAliases
public void SetRepositoryAliases()
{
using (new MercurialIniForTests())
using (var setup = new RepositorySetup("Dan"))
{
setup.EnsureNoHgrcExists();
var repository = setup.CreateSynchronizer().Repository;
var x = RepositoryAddress.Create("one", @"c:\one");
var y = RepositoryAddress.Create("two", @"http://two.org");
repository.SetKnownRepositoryAddresses(new List<RepositoryAddress>(new RepositoryAddress[]{x,y}));
Assert.AreEqual(2, repository.GetRepositoryPathsInHgrc().Count());
Assert.AreEqual(x.Name, repository.GetRepositoryPathsInHgrc().First().Name);
Assert.AreEqual(x.URI, repository.GetRepositoryPathsInHgrc().First().URI);
Assert.AreEqual(y.Name, repository.GetRepositoryPathsInHgrc().ToArray()[1].Name);
Assert.AreEqual(y.URI, repository.GetRepositoryPathsInHgrc().ToArray()[1].URI);
var z = RepositoryAddress.Create("three", @"http://three.org");
//this time, the hgrc does exist
repository.SetKnownRepositoryAddresses(new List<RepositoryAddress>(new RepositoryAddress[]{z}));
Assert.AreEqual(1, repository.GetRepositoryPathsInHgrc().Count());
Assert.AreEqual(z.Name, repository.GetRepositoryPathsInHgrc().First().Name);
Assert.AreEqual(z.URI, repository.GetRepositoryPathsInHgrc().First().URI);
}
}
示例10: SetAndGetDefaultSyncRepositories
public void SetAndGetDefaultSyncRepositories()
{
using (new MercurialIniForTests())
using (var setup = new RepositorySetup("Dan"))
{
setup.EnsureNoHgrcExists();
var repository = setup.CreateSynchronizer().Repository;
var x = RepositoryAddress.Create("one", @"c:\one");
var y = RepositoryAddress.Create("two", @"http://two.org");
var z = RepositoryAddress.Create("three", @"http://three.org");
repository.SetKnownRepositoryAddresses(new List<RepositoryAddress>(new RepositoryAddress[] { x, y,z }));
repository.SetDefaultSyncRepositoryAliases(new string[] {"one", "three"});
Assert.AreEqual(2, repository.GetDefaultSyncAliases().Count());
repository.SetDefaultSyncRepositoryAliases(new string[] { "two" });
Assert.AreEqual(1, repository.GetDefaultSyncAliases().Count());
}
}
示例11: GetUserName_NoHgrcYet_ReturnsDefault
public void GetUserName_NoHgrcYet_ReturnsDefault()
{
using (new MercurialIniForTests())
using (var setup = new RepositorySetup("Dan"))
{
setup.EnsureNoHgrcExists();
var repository = setup.CreateSynchronizer().Repository;
Assert.AreEqual("anonymous", repository.GetUserNameFromIni(_progress, "anonymous"));
}
}
示例12: GetUserName_NameInLocalReop_GetsName
public void GetUserName_NameInLocalReop_GetsName()
{
using (new MercurialIniForTests())
using (var setup = new RepositorySetup("Dan"))
{
setup.WriteIniContents(@"[ui]
username = joe
");
var repository = setup.CreateSynchronizer().Repository;
Assert.AreEqual("joe", repository.GetUserNameFromIni(_progress, "anonymous"));
}
}
示例13: GetUserName_EmptyHgrc_ReturnsDefault
public void GetUserName_EmptyHgrc_ReturnsDefault()
{
using (new MercurialIniForTests())
using (var setup = new RepositorySetup("Dan"))
{
setup.WriteIniContents(@"");
var repository = setup.CreateSynchronizer().Repository;
Assert.AreEqual("anonymous", repository.GetUserNameFromIni(_progress, "anonymous"));
}
}