diff --git a/IDisposableAnalyzers.Test/IDISP001DisposeCreatedTests/ValidCode.Cached.cs b/IDisposableAnalyzers.Test/IDISP001DisposeCreatedTests/ValidCode.Cached.cs index 5fe224c9..05a18d2a 100644 --- a/IDisposableAnalyzers.Test/IDISP001DisposeCreatedTests/ValidCode.Cached.cs +++ b/IDisposableAnalyzers.Test/IDISP001DisposeCreatedTests/ValidCode.Cached.cs @@ -17,11 +17,11 @@ namespace RoslynSandbox public static class Foo { - private static readonly ConcurrentDictionary Cache = new ConcurrentDictionary(); + private static readonly ConcurrentDictionary Cache = new ConcurrentDictionary(); - public static long Bar() + public static long Bar(string fileName) { - var stream = Cache.GetOrAdd(1, _ => File.OpenRead(string.Empty)); + var stream = Cache.GetOrAdd(fileName, x => File.OpenRead(x)); return stream.Length; } }