Exemple #1
0
        /// <summary>
        /// Examine the method and determine if it is suitable for
        /// any TestCaseBuilder to use in building a Test
        /// </summary>
        /// <param name="method">The method to be used as a test case</param>
        /// <param name="suite">The test suite for which the method is being built</param>
        /// <returns>True if the method can be used to build a Test</returns>
        public bool CanBuildFrom(MethodInfo method, Test suite)
        {
            foreach (ITestCaseBuilder builder in Extensions)
            {
                if (builder is ITestCaseBuilder2)
                {
                    ITestCaseBuilder2 builder2 = (ITestCaseBuilder2)builder;
                    if (builder2.CanBuildFrom(method, suite))
                    {
                        return(true);
                    }
                }
                else if (builder.CanBuildFrom(method))
                {
                    return(true);
                }
            }

            return(false);
        }