예제 #1
0
		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());
		}
예제 #2
0
        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());
        }
예제 #3
0
        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());
        }
예제 #4
0
        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());
        }