本文整理汇总了C#中RevFlagSet类的典型用法代码示例。如果您正苦于以下问题:C# RevFlagSet类的具体用法?C# RevFlagSet怎么用?C# RevFlagSet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RevFlagSet类属于命名空间,在下文中一共展示了RevFlagSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: hasAll
/**
* Create a new filter that tests all flags in a set.
*
* @param a
* set of flags to test.
* @return filter that selects only commits with all flags in <code>a</code>.
*/
public static RevFilter hasAll(params RevFlag[] a)
{
RevFlagSet set = new RevFlagSet();
foreach (RevFlag flag in a)
set.Add(flag);
return new HasAll(set);
}
示例2: testEmpty
public void testEmpty() {
final RevFlagSet set = new RevFlagSet();
assertEquals(0, set.mask);
assertEquals(0, set.size());
assertNotNull(set.iterator());
assertFalse(set.iterator().hasNext());
}
示例3: testEmpty
public void testEmpty()
{
var flagSet = new RevFlagSet();
Assert.AreEqual(0, flagSet.Mask);
Assert.AreEqual(0, flagSet.Count);
Assert.IsNotNull(flagSet.GetEnumerator());
Assert.IsFalse(flagSet.GetEnumerator().MoveNext());
}
示例4: TestEmpty
public virtual void TestEmpty()
{
RevFlagSet set = new RevFlagSet();
NUnit.Framework.Assert.AreEqual(0, set.mask);
NUnit.Framework.Assert.AreEqual(0, set.Count);
NUnit.Framework.Assert.IsNotNull(set.Iterator());
NUnit.Framework.Assert.IsFalse(set.Iterator().HasNext());
}
示例5: HasAllFilter
/// <summary>Create a new filter that tests all flags in a set.</summary>
/// <remarks>Create a new filter that tests all flags in a set.</remarks>
/// <param name="a">set of flags to test.</param>
/// <returns>filter that selects only commits with all flags in <code>a</code>.</returns>
public static RevFilter HasAllFilter(params RevFlag[] a)
{
RevFlagSet set = new RevFlagSet();
foreach (RevFlag flag in a)
{
set.AddItem(flag);
}
return new RevFlagFilter.HasAll(set);
}
示例6: TestAddTwo
public virtual void TestAddTwo()
{
RevFlag flag1 = rw.NewFlag("flag_1");
RevFlag flag2 = rw.NewFlag("flag_2");
NUnit.Framework.Assert.AreEqual(0, (flag1.mask & flag2.mask));
RevFlagSet set = new RevFlagSet();
NUnit.Framework.Assert.IsTrue(set.AddItem(flag1));
NUnit.Framework.Assert.IsTrue(set.AddItem(flag2));
NUnit.Framework.Assert.AreEqual(flag1.mask | flag2.mask, set.mask);
NUnit.Framework.Assert.AreEqual(2, set.Count);
}
示例7: testAddTwo
public void testAddTwo() {
final RevFlag flag1 = rw.newFlag("flag_1");
final RevFlag flag2 = rw.newFlag("flag_2");
assertTrue((flag1.mask & flag2.mask) == 0);
final RevFlagSet set = new RevFlagSet();
assertTrue(set.add(flag1));
assertTrue(set.add(flag2));
assertEquals(flag1.mask | flag2.mask, set.mask);
assertEquals(2, set.size());
}
示例8: testAddRevFlagSet
public void testAddRevFlagSet()
{
RevCommit a = Commit();
RevFlag flag1 = rw.newFlag("flag1");
RevFlag flag2 = rw.newFlag("flag2");
var s = new RevFlagSet { flag1, flag2 };
Assert.AreEqual(0, a.Flags);
a.add(s);
Assert.AreEqual(flag1.Mask | flag2.Mask, a.Flags);
}
示例9: testAddTwo
public void testAddTwo()
{
RevFlag flag1 = rw.newFlag("flag_1");
RevFlag flag2 = rw.newFlag("flag_2");
Assert.IsTrue((flag1.Mask & flag2.Mask) == 0);
var flagSet = new RevFlagSet();
Assert.IsTrue(flagSet.Add(flag1));
Assert.IsTrue(flagSet.Add(flag2));
Assert.AreEqual(flag1.Mask | flag2.Mask, flagSet.Mask);
Assert.AreEqual(2, flagSet.Count);
}
示例10: TestAddOne
public virtual void TestAddOne()
{
string flagName = "flag";
RevFlag flag = rw.NewFlag(flagName);
NUnit.Framework.Assert.IsTrue(0 != flag.mask);
NUnit.Framework.Assert.AreSame(flagName, flag.name);
RevFlagSet set = new RevFlagSet();
NUnit.Framework.Assert.IsTrue(set.AddItem(flag));
NUnit.Framework.Assert.IsFalse(set.AddItem(flag));
NUnit.Framework.Assert.AreEqual(flag.mask, set.mask);
NUnit.Framework.Assert.AreEqual(1, set.Count);
Iterator<RevFlag> i = set.Iterator();
NUnit.Framework.Assert.IsTrue(i.HasNext());
NUnit.Framework.Assert.AreSame(flag, i.Next());
NUnit.Framework.Assert.IsFalse(i.HasNext());
}
示例11: testAddOne
public void testAddOne() {
final String flagName = "flag";
final RevFlag flag = rw.newFlag(flagName);
assertTrue(0 != flag.mask);
assertSame(flagName, flag.name);
final RevFlagSet set = new RevFlagSet();
assertTrue(set.add(flag));
assertFalse(set.add(flag));
assertEquals(flag.mask, set.mask);
assertEquals(1, set.size());
final Iterator<RevFlag> i = set.iterator();
assertTrue(i.hasNext());
assertSame(flag, i.next());
assertFalse(i.hasNext());
}
示例12: testAddOne
public void testAddOne()
{
const string flagName = "flag";
RevFlag flag = rw.newFlag(flagName);
Assert.IsTrue(0 != flag.Mask);
Assert.AreSame(flagName, flag.Name);
var flagSet = new RevFlagSet();
Assert.IsTrue(flagSet.Add(flag));
Assert.IsFalse(flagSet.Add(flag));
Assert.AreEqual(flag.Mask, flagSet.Mask);
Assert.AreEqual(1, flagSet.Count);
var i = flagSet.GetEnumerator();
Assert.IsTrue(i.MoveNext());
Assert.AreSame(flag, i.Current);
Assert.IsFalse(i.MoveNext());
}
示例13: add
/**
* Add a set of flags to this object.
*
* @param set
* the set of flags to mark on this object, for later testing.
*/
public void add(RevFlagSet set)
{
flags |= set.mask;
}
示例14: UploadPack
/// <summary>
/// Create a new pack upload for an open repository.
/// </summary>
/// <param name="copyFrom">the source repository.</param>
public UploadPack(Repository copyFrom)
{
_db = copyFrom;
_walk = new RevWalk.RevWalk(_db);
_walk.setRetainBody(false);
ADVERTISED = _walk.newFlag("ADVERTISED");
WANT = _walk.newFlag("WANT");
PEER_HAS = _walk.newFlag("PEER_HAS");
COMMON = _walk.newFlag("COMMON");
_walk.carry(PEER_HAS);
SAVE = new RevFlagSet { ADVERTISED, WANT, PEER_HAS };
_refFilter = RefFilterContants.DEFAULT;
}
示例15: TestContains
public virtual void TestContains()
{
RevFlag flag1 = rw.NewFlag("flag_1");
RevFlag flag2 = rw.NewFlag("flag_2");
RevFlagSet set = new RevFlagSet();
set.AddItem(flag1);
NUnit.Framework.Assert.IsTrue(set.Contains(flag1));
NUnit.Framework.Assert.IsFalse(set.Contains(flag2));
NUnit.Framework.Assert.IsFalse(set.Contains("bob"));
}