We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1633f44 commit 8bace7aCopy full SHA for 8bace7a
1 file changed
IDisposableAnalyzers.Test/IDISP003DisposeBeforeReassigningTests/Valid.cs
@@ -1328,5 +1328,31 @@ public class C
1328
1329
RoslynAssert.Valid(Analyzer, code);
1330
}
1331
+
1332
+ [Test]
1333
+ public static void AssigningInjectedInFactoryMethod()
1334
+ {
1335
+ var code = @"
1336
+namespace N
1337
+{
1338
+ using System;
1339
+ using System.Threading;
1340
1341
+ public class C
1342
1343
+ private IDisposable disposable;
1344
1345
+ public static C M(IDisposable d)
1346
1347
+ var c = new C();
1348
+ c.disposable = d;
1349
+ c.disposable = null;
1350
+ return c;
1351
+ }
1352
1353
+}";
1354
1355
+ RoslynAssert.Valid(Analyzer, code);
1356
1357
1358
0 commit comments