Example #1
0
        public void PowerSet2CombinatoricsCompleteTests1TwoItems()
        {
            var expected = new List <List <int> >
            {
                new List <int>(),
                new List <int>()
                {
                    1
                },
                new List <int>()
                {
                    2
                },
                new List <int>()
                {
                    1, 2
                }
            };
            var actual = PowerSet2CombinatoricsComplete.GetPowerSet(new[] { 1, 2 });

            Assert.AreEqual(actual.Count, expected.Count);
            for (var i = 0; i < expected.Count; i++)
            {
                CollectionAssert.AreEqual(expected[i], actual[i]);
            }
        }
Example #2
0
        public void PowerSet2CombinatoricsCompleteTests1EmptySet()
        {
            var expected = new List <List <int> >
            {
                new List <int>()
            };
            var actual = PowerSet2CombinatoricsComplete.GetPowerSet(new int[0]);

            Assert.AreEqual(actual.Count, expected.Count);
            for (var i = 0; i < expected.Count; i++)
            {
                CollectionAssert.AreEqual(expected[i], actual[i]);
            }
        }