Esempio n. 1
0
        /// <summary>
        ///Default 的测试
        ///</summary>
        public void DefaultTestHelper <TCase, TOther>()
        {
            SwithCaseExtension.SwithCase <TCase, TOther> sc = null;
            TOther other = default(TOther);

            SwithCaseExtension.Default <TCase, TOther>(sc, other);
            Assert.Inconclusive("无法验证不返回值的方法。");
        }
Esempio n. 2
0
        /// <summary>
        ///Switch 的测试
        ///</summary>
        public void SwitchTestHelper <TCase, TOther>()
            where TCase : IEquatable <T>
        {
            TCase           t      = default(TCase);
            Action <TOther> action = null;

            SwithCaseExtension.SwithCase <TCase, TOther> expected = null;
            SwithCaseExtension.SwithCase <TCase, TOther> actual;
            actual = SwithCaseExtension.Switch <TCase, TOther>(t, action);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Esempio n. 3
0
        /// <summary>
        ///Case 的测试
        ///</summary>
        public void CaseTest1Helper <TCase, TOther>()
            where TCase : IEquatable <T>
        {
            SwithCaseExtension.SwithCase <TCase, TOther> sc = null;
            Predicate <TCase> predict = null;
            TOther            other   = default(TOther);

            SwithCaseExtension.SwithCase <TCase, TOther> expected = null;
            SwithCaseExtension.SwithCase <TCase, TOther> actual;
            actual = SwithCaseExtension.Case <TCase, TOther>(sc, predict, other);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Esempio n. 4
0
        /// <summary>
        ///Switch 的测试
        ///</summary>
        public void SwitchTest1Helper <TInput, TCase, TOther>()

            where TCase : IEquatable <T>
        {
            TInput t = default(TInput);
            Func <TInput, TCase> selector = null;
            Action <TOther>      action   = null;

            SwithCaseExtension.SwithCase <TCase, TOther> expected = null;
            SwithCaseExtension.SwithCase <TCase, TOther> actual;
            actual = SwithCaseExtension.Switch <TInput, TCase, TOther>(t, selector, action);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }
Esempio n. 5
0
        /// <summary>
        ///Case 的测试
        ///</summary>
        public void CaseTest2Helper <TCase, TOther>()
            where TCase : IEquatable <T>
        {
            SwithCaseExtension.SwithCase <TCase, TOther> sc = null;
            TCase  option = default(TCase);
            TOther other  = default(TOther);
            bool   bBreak = false;

            SwithCaseExtension.SwithCase <TCase, TOther> expected = null;
            SwithCaseExtension.SwithCase <TCase, TOther> actual;
            actual = SwithCaseExtension.Case <TCase, TOther>(sc, option, other, bBreak);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }