예제 #1
0
        public void TestRemoveElement()
        {
            var lst       = new IdentifiableList <Ressources.RessourceString>();
            var ressource = new Ressources.RessourceString("test2", "value");

            lst.Add(new Ressources.RessourceString("test", "value"));
            lst.Add(ressource);

            Assert.IsTrue(lst.Count == 2);
            Assert.IsTrue(lst.Ids.Count() == 2);
            Assert.IsTrue(lst.RemovedElement.Count() == 0);
            Assert.IsTrue(lst.Count() == 2);

            lst.Remove("test");
            Assert.IsTrue(lst.Count == 1);
            Assert.IsTrue(lst.Ids.Count() == 1);
            Assert.IsTrue(lst.RemovedElement.Count() == 1);
            Assert.IsTrue(lst.Count() == 1);

            lst.Remove(ressource);
            Assert.IsTrue(lst.Count == 0);
            Assert.IsTrue(lst.Ids.Count() == 0);
            Assert.IsTrue(lst.RemovedElement.Count() == 2);
            Assert.IsTrue(lst.Count() == 0);
        }
예제 #2
0
        public void TestContains()
        {
            var lst       = new IdentifiableList <Ressources.RessourceString>();
            var ressource = new Ressources.RessourceString("test2", "value");

            lst.Add(new Ressources.RessourceString("test", "value"));

            Assert.IsTrue(lst.Contains("test"));
            Assert.IsFalse(lst.Contains("test2"));
        }