示例#1
0
        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());
        }
示例#2
0
        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());
        }