Custom Extension with Generated Parameterized Test

Asked by Gert Jansen van Rensburg

I am writing an Extensions that auto generates arguments for a test based on the test method signature.

The only issue I have, is that I can not assign these generated arguments to an instance of NUnitTestMethod, as the arugments field is marked as internal

How would you suggest I go about achieving this. My extention can be found at https://github.com/gertjvr/AutoFixture the nunit branch.

I really dont want to duplicate the whole nunit framework just so I can assign a value to internal field.

Question information

Language:
English Edit question
Status:
Solved
For:
NUnit V2 Edit question
Assignee:
No assignee Edit question
Solved by:
Gert Jansen van Rensburg
Solved:
Last query:
Last reply:
Revision history for this message
Charlie Poole (charlie.poole) said :
#1

I only had a cursory look at your code on GitHub, so I may have missed
something. It appears that you only want to provide test case
arguments automatically, based on the signature. However, you appear
to be building the entire NUnitTestMethod yourself rather than using
the extension point for test case data providers. Have you looked at
having an addin that simply implements ITestCaseProvider? That
extension would then be used by the built-in NUnitTestCaseBuilder,
which you would not have to modify in any way.

Because the various data providers are also extension points, we
didn't anticipate that any extension would need to directly write the
arguments of a test. Of course, if it turns out that you do need it
for some reason I'm not seeing, you should feel free to submit a bug
report.

Charlie

On Sat, Aug 24, 2013 at 8:01 PM, Gert Jansen van Rensburg
<email address hidden> wrote:
> New question #234577 on NUnit V2:
> https://answers.launchpad.net/nunitv2/+question/234577
>
> I am writing an Extensions that auto generates arguments for a test based on the test method signature.
>
> The only issue I have, is that I can not assign these generated arguments to an instance of NUnitTestMethod, as the arugments field is marked as internal
>
> How would you suggest I go about achieving this. My extention can be found at https://github.com/gertjvr/AutoFixture the nunit branch.
>
> I really dont want to duplicate the whole nunit framework just so I can assign a value to internal field.
>
> --
> You received this question notification because you are an answer
> contact for NUnit V2.

Revision history for this message
Gert Jansen van Rensburg (gertjvr) said :
#2

Hi Charlie, thanks for the quick response, I did have a provider but thought I had to use the builder aswell, haven't tried just using a ITestCaseProvider by it self.

Will give it a try and let you know how it goes.

Thanks again.

Also my github repository wasn't up to date, just push new code.

Revision history for this message
Gert Jansen van Rensburg (gertjvr) said :
#3

Worked thanks