本文整理汇总了C#中RefMap.put方法的典型用法代码示例。如果您正苦于以下问题:C# RefMap.put方法的具体用法?C# RefMap.put怎么用?C# RefMap.put使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RefMap
的用法示例。
在下文中一共展示了RefMap.put方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: testPut_KeyMustMatchName_WithPrefix
public void testPut_KeyMustMatchName_WithPrefix()
{
global::GitSharp.Core.Ref refA = newRef("refs/heads/A", ID_ONE);
RefMap map = new RefMap("refs/heads/", packed, loose, resolved);
try
{
map.put("FOO", refA);
Assert.Fail("map accepted invalid key/value pair");
}
catch (ArgumentException err)
{
// expected
}
}
示例2: testPut_WithPrefix
public void testPut_WithPrefix()
{
global::GitSharp.Core.Ref refA_one = newRef("refs/heads/A", ID_ONE);
global::GitSharp.Core.Ref refA_two = newRef("refs/heads/A", ID_TWO);
packed = toList(refA_one);
RefMap map = new RefMap("refs/heads/", packed, loose, resolved);
Assert.AreSame(refA_one, map.get("A"));
Assert.AreSame(refA_one, map.put("A", refA_two));
// map changed, but packed, loose did not
Assert.AreSame(refA_two, map.get("A"));
Assert.AreSame(refA_one, packed.get(0));
Assert.AreEqual(0, loose.size());
Assert.AreSame(refA_two, map.put("A", refA_one));
Assert.AreSame(refA_one, map.get("A"));
}
示例3: testPut_CollapseResolved
public void testPut_CollapseResolved()
{
global::GitSharp.Core.Ref master = newRef("refs/heads/master", ID_ONE);
global::GitSharp.Core.Ref headU = newRef("HEAD", "refs/heads/master");
global::GitSharp.Core.Ref headR = newRef("HEAD", master);
global::GitSharp.Core.Ref a = newRef("refs/heads/A", ID_ONE);
loose = toList(headU, master);
resolved = toList(headR);
RefMap map = new RefMap("", packed, loose, resolved);
Assert.IsNull(map.put(a.getName(), a));
Assert.AreSame(a, map.get(a.getName()));
Assert.AreSame(headR, map.get("HEAD"));
}