Exemple #1
0
        public void ContainsPossibleTest()
        {
            IPossible find = new Possible()
            {
                5, 2, 3, 8
            };
            IPossible noFind = new Possible()
            {
                2, 3, 8, 10
            };

            IPossible p1 = new Possible()
            {
                6, 7, 8, 9, 10
            };
            IPossible p2 = new Possible()
            {
                2, 3, 5, 8
            };
            IPossible p3 = new Possible()
            {
                3, 7, 10, 12
            };
            ISetOfSets <IPossible> group = new SetOfSets <IPossible>()
            {
                p1, p2, p3
            };

            Assert.IsTrue(group.Contains(find), "Could not find 2,3,5,8");
            Assert.IsFalse(group.Contains(noFind), "Found 2,3,8,10");
        }
Exemple #2
0
        public void DoesNotContainAnyTest()
        {
            IPossible p1 = new Possible()
            {
                6, 7, 8, 9, 10
            };
            IPossible p2 = new Possible()
            {
                2, 3, 5, 8
            };
            IPossible p3 = new Possible()
            {
                3, 7, 10, 12
            };
            ISetOfSets <IPossible> group1 = new SetOfSets <IPossible>()
            {
                p1, p2, p3
            };

            IPossible q1 = new Possible()
            {
                8, 3, 7, 22
            };
            IPossible q2 = new Possible()
            {
                2, 3, 8, 10
            };
            ISetOfSets <IPossible> group2 = new SetOfSets <IPossible>()
            {
                q1, q2
            };

            Assert.IsTrue(group1.DoesNotContainAny(group2), "Could not find 2,3,5,8");

            IPossible q3 = new Possible()
            {
                5, 3, 2, 8
            };

            group2.Add(q3);

            Assert.IsFalse(group1.DoesNotContainAny(group2), "Found 2,3,8,10");
        }
Exemple #3
0
        public void ContainsAllPossibleTest()
        {
            IPossible f1 = new Possible()
            {
                2, 3, 5, 8
            };
            IPossible f2 = new Possible()
            {
                3, 7, 10, 12
            };
            ISetOfSets <IPossible> group1 = new SetOfSets <IPossible>()
            {
                f1, f2
            };

            IPossible p1 = new Possible()
            {
                2, 3, 5, 8
            };
            IPossible p2 = new Possible()
            {
                3, 7, 10, 12
            };
            IPossible p3 = new Possible()
            {
                6, 7, 8, 9, 10
            };
            ISetOfSets <IPossible> group2 = new SetOfSets <IPossible>()
            {
                p1, p2, p3
            };

            Assert.IsTrue(group2.ContainsAll(group1), "Could not find group1");

            IPossible f3 = new Possible()
            {
                6, 7, 8
            };

            group1.Add(f3);
            Assert.IsFalse(group2.ContainsAll(group1), "Found all group1");
        }
        public void CheckCategoryCount()
        {
            IPossible cat1 = new Possible()
            {
                1, 2, 3, 4, 5
            };
            IPossible cat2 = new Possible()
            {
                6, 7, 8, 9, 10
            };
            IPossible cat3 = new Possible()
            {
                11, 12, 13, 14, 15
            };
            IList <IPossible> categories = new List <IPossible>()
            {
                cat1, cat2, cat3
            };

            IPossible p1 = new Possible()
            {
                4, 7, 11, 13
            };
            IPossible p2 = new Possible()
            {
                2, 3, 5, 8
            };
            IPossible p3 = new Possible()
            {
                3, 7, 10, 12
            };
            ISetOfSets <IPossible> group = new SetOfSets <IPossible>()
            {
                p1, p2, p3
            };

            IPossibleProperties <IPossible, int> count = group.CategoryCount(categories);

            Assert.AreEqual(3, count[cat1]);
            Assert.AreEqual(3, count[cat2]);
            Assert.AreEqual(2, count[cat3]);
        }