当前位置: 首页>>代码示例>>C#>>正文


C# RevFlagSet类代码示例

本文整理汇总了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);
 }
开发者ID:stephensong,项目名称:GitSharp,代码行数:14,代码来源:RevFlagFilter.cs

示例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());
	}
开发者ID:stephensong,项目名称:GitSharp,代码行数:7,代码来源:RevFlagSetTest.cs

示例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());
		}
开发者ID:dev218,项目名称:GitSharp,代码行数:8,代码来源:RevFlagSetTest.cs

示例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());
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:8,代码来源:RevFlagSetTest.cs

示例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);
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:13,代码来源:RevFlagFilter.cs

示例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);
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:11,代码来源:RevFlagSetTest.cs

示例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());
	}
开发者ID:stephensong,项目名称:GitSharp,代码行数:11,代码来源:RevFlagSetTest.cs

示例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);
        }
开发者ID:jagregory,项目名称:GitSharp,代码行数:12,代码来源:RevObjectTest.cs

示例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);
        }
开发者ID:jagregory,项目名称:GitSharp,代码行数:12,代码来源:RevFlagSetTest.cs

示例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());
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:16,代码来源:RevFlagSetTest.cs

示例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());
	}
开发者ID:stephensong,项目名称:GitSharp,代码行数:16,代码来源:RevFlagSetTest.cs

示例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());
        }
开发者ID:jagregory,项目名称:GitSharp,代码行数:17,代码来源:RevFlagSetTest.cs

示例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;
 }
开发者ID:ArildF,项目名称:GitSharp,代码行数:10,代码来源:RevObject.cs

示例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;
        }
开发者ID:dev218,项目名称:GitSharp,代码行数:19,代码来源:UploadPack.cs

示例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"));
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:10,代码来源:RevFlagSetTest.cs


注:本文中的RevFlagSet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。