本文整理汇总了C#中LibChorus.TestUtilities.RepositorySetup.SyncWithOptions方法的典型用法代码示例。如果您正苦于以下问题:C# RepositorySetup.SyncWithOptions方法的具体用法?C# RepositorySetup.SyncWithOptions怎么用?C# RepositorySetup.SyncWithOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibChorus.TestUtilities.RepositorySetup
的用法示例。
在下文中一共展示了RepositorySetup.SyncWithOptions方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
示例2: FileDeletedRemotelyAndChangedLocallyKeepsChanged
public void FileDeletedRemotelyAndChangedLocallyKeepsChanged()
{
using(var localRepo = new RepositorySetup("unbundleTests"))
{
var localFilePath = localRepo.ProjectFolder.GetNewTempFile(true).Path;
localRepo.AddAndCheckinFile(localFilePath, "file to change and delete");
using(var remoteRepo = new RepositorySetup("remote", localRepo))
{
remoteRepo.CheckinAndPullAndMerge();
var remoteFilePath = Path.Combine(remoteRepo.ProjectFolder.Path, Path.GetFileName(localFilePath));
remoteRepo.ChangeFileAndCommit(remoteFilePath, "new contents", "changed file");
File.Delete(localFilePath);
localRepo.SyncWithOptions(new SyncOptions { CheckinDescription = "delete file", DoMergeWithOthers = false, DoPullFromOthers = false, DoSendToOthers = false });
localRepo.CheckinAndPullAndMerge(remoteRepo);
Assert.That(File.Exists(localFilePath), Is.True, "Did not keep changed file.");
var chorusNotesPath = localFilePath + ".ChorusNotes";
Assert.That(File.Exists(chorusNotesPath), "Did not record conflict");
AssertThatXmlIn.File(chorusNotesPath).HasAtLeastOneMatchForXpath("//annotation[@class='mergeconflict']");
}
}
}