You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Unit Tests the analyzer treats the setup and teardown methods specially in the sense, that a disposable created in a setup method and disposed in a tear down method do not generate IDISP003 and IDISP006 diagnostics.
In a wpf application, there is a simmilar method pair OnStartup and OnExit. I think it should be valid code, to initialize a disposable in OnStartUp, when its disposed in OnExit. So the following two snippets should be somewhat simmilar:
public class Foo
{
private IDisposable _foo = null!;
[SetUp]
public void Setup()
{
_foo = new Disposable();
}
[TearDown]
public void TearDown()
{
_foo.Dispose();
}
}
In Unit Tests the analyzer treats the setup and teardown methods specially in the sense, that a disposable created in a setup method and disposed in a tear down method do not generate
IDISP003
andIDISP006
diagnostics.In a wpf application, there is a simmilar method pair
OnStartup
andOnExit
. I think it should be valid code, to initialize a disposable inOnStartUp
, when its disposed inOnExit
. So the following two snippets should be somewhat simmilar:The text was updated successfully, but these errors were encountered: