Example #1
0
        public void Remove()
        {
            RoleGroupCollection rgc = new RoleGroupCollection();

            rgc.Remove(null);

            RoleGroup rg1 = new RoleGroup();

            rgc.Remove(rg1);
            rgc.Add(rg1);
            rgc.Add(rg1);
            Assert.AreEqual(2, rgc.Count, "Count");
            rgc.Remove(rg1);
            Assert.IsTrue(rgc.Contains(rg1), "rg1-bis");

            RoleGroup rg2 = new RoleGroup();

            rgc.Add(rg2);
            rgc.Remove(rg2);
            rgc.Remove(rg2);
        }
Example #2
0
        public void Contains()
        {
            RoleGroupCollection rgc = new RoleGroupCollection();

            Assert.IsFalse(rgc.Contains(null), "null");

            RoleGroup rg1 = new RoleGroup();

            rgc.Add(rg1);
            Assert.IsTrue(rgc.Contains(rg1), "1a");

            RoleGroup rg2 = new RoleGroup();

            Assert.IsFalse(rgc.Contains(rg2), "2a");
            rgc.Add(rg2);
            Assert.IsTrue(rgc.Contains(rg2), "2b");

            rgc.Remove(rg1);
            Assert.IsFalse(rgc.Contains(rg1), "1b");
        }