示例#1
0
        public RowTestCase CreateRowTestCase(Attribute row, MethodInfo method)
        {
            if (row == null)
            {
                throw new ArgumentNullException("row");
            }

            if (method == null)
            {
                throw new ArgumentNullException("method");
            }

            object[] rowArguments = RowTestFramework.GetRowArguments(row);
            rowArguments = FilterSpecialValues(rowArguments);

            string testName = RowTestFramework.GetTestName(row);
            Type   expectedExceptionType = RowTestFramework.GetExpectedExceptionType(row);

            RowTestCase testCase = new RowTestCase(method, testName, rowArguments);

            if (expectedExceptionType != null)
            {
                //testCase.ExceptionExpected = true;
                //testCase.ExpectedExceptionType = expectedExceptionType;
                //testCase.ExpectedMessage = RowTestFramework.GetExpectedExceptionMessage(row);
                testCase.ExceptionProcessor = new ExpectedExceptionProcessor(testCase, row);
            }

            return(testCase);
        }
示例#2
0
        private object[] FilterSpecialValues(object[] arguments)
        {
            if (arguments == null)
            {
                return(null);
            }

            for (int i = 0; i < arguments.Length; i++)
            {
                if (RowTestFramework.IsSpecialValue(arguments[i]))
                {
                    arguments[i] = MapSpecialValue(arguments[i]);
                }
            }

            return(arguments);
        }