DefaultTestCaseBuilder
Class to build ether a parameterized or a normal NUnitTestMethod.
There are four cases that the builder must deal with:
1. The method needs no params and none are provided
2. The method needs params and they are provided
3. The method needs no params but they are provided in error
4. The method needs params but they are not provided
This could have been done using two different builders, but it
turned out to be simpler to have just one. The BuildFrom method
takes a different branch depending on whether any parameters are
provided, but all four cases are dealt with in lower-level methods
public DefaultTestCaseBuilder()
Build a Test from the provided MethodInfo. Depending on
whether the method takes arguments and on the availability
of test case data, this method may return a single test
or a group of tests contained in a ParameterizedMethodSuite.
Build a Test from the provided MethodInfo. Depending on
whether the method takes arguments and on the availability
of test case data, this method may return a single test
or a group of tests contained in a ParameterizedMethodSuite.
Determines if the method can be used to build an NUnit test
test method of some kind. The method must normally be marked
with an identifying attribute for this to be true.
Note that this method does not check that the signature
of the method for validity. If we did that here, any
test methods with invalid signatures would be passed
over in silence in the test run. Since we want such
methods to be reported, the check for validity is made
in BuildFrom rather than here.
Determines if the method can be used to build an NUnit test
test method of some kind. The method must normally be marked
with an identifying attribute for this to be true.
Note that this method does not check that the signature
of the method for validity. If we did that here, any
test methods with invalid signatures would be passed
over in silence in the test run. Since we want such
methods to be reported, the check for validity is made
in BuildFrom rather than here.