예제 #1
0
        public void AddStringElementTest()
        {
            Multiplicity <string> multiplicity = new Multiplicity <string>();

            multiplicity.Insert("ololo");
            Assert.IsTrue(multiplicity.ExistenceChecking("ololo"));
        }
예제 #2
0
        public void AddIntElementTest()
        {
            Multiplicity <int> multiplicity = new Multiplicity <int>();

            multiplicity.Insert(1);
            Assert.IsTrue(multiplicity.ExistenceChecking(1));
        }
예제 #3
0
        public void RemovingOfElementTest()
        {
            Multiplicity <int> multiplicity = new Multiplicity <int>();

            multiplicity.Insert(1);
            multiplicity.RemovingOfElement(1);
            Assert.IsTrue(multiplicity.IsEmpty());
        }
예제 #4
0
        public void UnionTest()
        {
            Multiplicity <int> multiplicity1 = new Multiplicity <int>();

            multiplicity1.Insert(1);
            Multiplicity <int> multiplicity2 = new Multiplicity <int>();
            Multiplicity <int> result        = new Multiplicity <int>();

            result.Union(multiplicity1, multiplicity2);
            Assert.IsFalse(result.IsEmpty());
        }
예제 #5
0
        public void Intersection1Test()
        {
            Multiplicity <int> multiplicity1 = new Multiplicity <int>();

            multiplicity1.Insert(1);
            Multiplicity <int> multiplicity2 = new Multiplicity <int>();

            multiplicity2.Insert(2);
            Multiplicity <int> result = new Multiplicity <int>();

            result.Insert(1234);
            result.Intersection(multiplicity1, multiplicity2);
            Assert.IsTrue(result.IsEmpty());
        }