本文整理汇总了C#中LibChorus.TestUtilities.RepositorySetup.EnsureNoHgrcExists方法的典型用法代码示例。如果您正苦于以下问题:C# RepositorySetup.EnsureNoHgrcExists方法的具体用法?C# RepositorySetup.EnsureNoHgrcExists怎么用?C# RepositorySetup.EnsureNoHgrcExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LibChorus.TestUtilities.RepositorySetup
的用法示例。
在下文中一共展示了RepositorySetup.EnsureNoHgrcExists方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnsureTheseExtensionAreEnabled_noExistingExtensions_AddsThem
public void EnsureTheseExtensionAreEnabled_noExistingExtensions_AddsThem()
{
using (new MercurialIniForTests())
using (var setup = new RepositorySetup("Dan"))
{
setup.EnsureNoHgrcExists();
var extensions = new Dictionary<string, string>();
extensions.Add("a","");
extensions.Add("b", "");
setup.Repository.EnsureTheseExtensionsAndFormatSet(extensions);
Assert.AreEqual("a", setup.Repository.GetEnabledExtension().First());
Assert.AreEqual("b", setup.Repository.GetEnabledExtension().ToArray()[1]);
}
}
示例2: 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"));
}
}
示例3: 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);
}
}
示例4: 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);
}
}
示例5: 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);
}
}
示例6: 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);
}
}
示例7: 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);
}
}
示例8: 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());
}
}
示例9: 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"));
}
}