| Issue 67: | ExtractResourceAttribute fails with multiple attributes on a test | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Sign in to add a comment
|
The following sample fails with a NullReferenceException.
[Test]
[ExtractResource("StandardMessages.xml", "StandardMessages.xml")]
[ExtractResource("AdditionalMessages.xml",
"AdditionalMessages.xml")]
public void MultipleMessageFilesCanBeLoaded()
{
...
}
The failure is due to the constructor of the ExtractResourceRunInvoker
expecting a MethodRunInvoker to get the declaring type information for the
attribute if the declaring type is null.
I checked the trunk and it appears to still be present although I
discovered the error off a version of the attribute that was not included
in the project.
I fixed the issue by adding a block that checks for an
ExtractResourceRunInvoker and gets the type of the attribute present there,
but this fix would not be guaranteed in the presence of other decorators.
|
||||||||||
,
Sep 24, 2007
(No comment was entered for this change.)
Labels: Milestone-2.4.2
|
|||||||||||
,
Mar 06, 2008
Your fix works when supplying a destination for the extracted resource, however the alternative option (using a stream) relies on a static member of the ExtractResourceAttribute class. This means there can only be one resource open at a time, with the current implementation.
Status: Accepted
Owner: grahamrhay |
|||||||||||
,
Mar 06, 2008
I realize that, You may want to document the limitation. We haven't been using the stream alternative due to that limitation. |
|||||||||||
,
Mar 07, 2008
In any case, this feature will not be carried forward to MbUnit v3 as-is. In v3, access to the contents of resources in place will be provided through data-binding. Then we can also have a decorator similar to the existing feature that provides for extraction to disk. |
|||||||||||
| ► Sign in to add a comment | |||||||||||