DataAttribute
with disposable data
#2610
-
I am writing some integration tests where we have multiple hardware devices connected to the build server, and we run the test for each device separately. I did the whole But now I'm dealing with the following issue: how do I dispose my data? At first I did basically this:
But then it turned out that So at this point I don't know where I can dispose of my connection. Especially with physical hardware it is important to properly close the connection. Is there any kind of extension point where I can release data generated by a |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The fact that your data items implement |
Beta Was this translation helpful? Give feedback.
The fact that your data items implement
IDisposable
is enough: we will automatically callDispose()
when we're done with the data item. There's no need for you to try to callDispose()
yourself.