コード例 #1
0
        public void CombineTest_NLessThanK()
        {
            var solution = new _077_Combinations();
            var result   = solution.Combine(2, 3);

            Assert.IsNull(result);
        }
コード例 #2
0
        public void CombineTest_KEqual0()
        {
            var solution = new _077_Combinations();
            var result   = solution.Combine(4, 0);

            Assert.IsNull(result);
        }
コード例 #3
0
        public void CombineTest_2()
        {
            var solution = new _077_Combinations();
            var result   = solution.Combine(5, 2);

            Assert.AreEqual(10, result.Count);
        }
コード例 #4
0
        public void CombineTest_NLessThanK()
        {
            var solution = new _077_Combinations();
            var result = solution.Combine(2, 3);

            Assert.IsNull(result);
        }
コード例 #5
0
        public void CombineTest_NEqual0()
        {
            var solution = new _077_Combinations();
            var result = solution.Combine(0, 3);

            Assert.IsNull(result);
        }
コード例 #6
0
        public void CombineTest_2()
        {
            var solution = new _077_Combinations();
            var result = solution.Combine(5, 2);

            Assert.AreEqual(10, result.Count);
        }
コード例 #7
0
        public void CombineTest_KEqualN()
        {
            var solution = new _077_Combinations();
            var result   = solution.Combine(4, 4);

            Assert.AreEqual(1, result.Count);
            AssertHelper.AssertList(new int[] { 1, 2, 3, 4 }, result[0]);
        }
コード例 #8
0
        public void CombineTest_KEqualN()
        {
            var solution = new _077_Combinations();
            var result = solution.Combine(4, 4);

            Assert.AreEqual(1, result.Count);
            AssertHelper.AssertList(new int[] { 1, 2, 3, 4 }, result[0]);
        }
コード例 #9
0
        public void CombineTest()
        {
            var solution = new _077_Combinations();
            var result   = solution.Combine(4, 2);

            Assert.AreEqual(6, result.Count);
            AssertHelper.AssertList(new int[] { 1, 2 }, result[0]);
            AssertHelper.AssertList(new int[] { 1, 3 }, result[1]);
            AssertHelper.AssertList(new int[] { 2, 3 }, result[2]);
            AssertHelper.AssertList(new int[] { 1, 4 }, result[3]);
            AssertHelper.AssertList(new int[] { 2, 4 }, result[4]);
            AssertHelper.AssertList(new int[] { 3, 4 }, result[5]);
        }
コード例 #10
0
        public void CombineTest()
        {
            var solution = new _077_Combinations();
            var result = solution.Combine(4, 2);

            Assert.AreEqual(6, result.Count);
            AssertHelper.AssertList(new int[] { 1, 2 }, result[0]);
            AssertHelper.AssertList(new int[] { 1, 3 }, result[1]);
            AssertHelper.AssertList(new int[] { 2, 3 }, result[2]);
            AssertHelper.AssertList(new int[] { 1, 4 }, result[3]);
            AssertHelper.AssertList(new int[] { 2, 4 }, result[4]);
            AssertHelper.AssertList(new int[] { 3, 4 }, result[5]);
        }