コード例 #1
0
            TestCaseData GenPayData
                (int fullYears, double expectedPay, Exception exception = null)
            {
                TestCaseData data = GenData(fullYears);

                data.SetDescription(string.Format(descriptionPatternPay, fullYears, expectedPay));
                if (exception != null)
                {
                    data.Throws(exception.GetType());
                }
                else
                {
                    data.Returns(expectedPay);
                }
                return(data);
            }
コード例 #2
0
 /// <summary>
 /// Wrapper for underlying <see cref="TestCaseData.Throws(System.Type)"/> using a generic for the type.
 /// </summary>
 public static TestCaseData Throws <TException>(this TestCaseData testCase)
 {
     return(testCase.Throws(typeof(TException)));
 }