File tree Expand file tree Collapse file tree 2 files changed +9
-31
lines changed
TestableIO.System.IO.Abstractions.TestingHelpers
TestableIO.System.IO.Abstractions.Wrappers Expand file tree Collapse file tree 2 files changed +9
-31
lines changed Original file line number Diff line number Diff line change 1- using System ;
2- using System . Collections . Generic ;
3- using System . Linq ;
4- using System . Text ;
5- using System . Threading . Tasks ;
6-
7- namespace System . IO . Abstractions . TestingHelpers
1+ namespace System . IO . Abstractions . TestingHelpers
82{
93 /// <inheritdoc />
104#if FEATURE_SERIALIZABLE
115 [ Serializable ]
126#endif
137 public class MockFileVersionInfoFactory : IFileVersionInfoFactory
148 {
15- private static IMockFileDataAccessor mockFileSystem ;
9+ private readonly IMockFileDataAccessor mockFileSystem ;
1610
1711 /// <inheritdoc />
1812 public MockFileVersionInfoFactory ( IMockFileDataAccessor mockFileSystem )
1913 {
20- MockFileVersionInfoFactory . mockFileSystem = mockFileSystem ?? throw new ArgumentNullException ( nameof ( mockFileSystem ) ) ;
14+ this . mockFileSystem = mockFileSystem ?? throw new ArgumentNullException ( nameof ( mockFileSystem ) ) ;
2115 }
2216
2317 /// <inheritdoc />
2418 public IFileSystem FileSystem => mockFileSystem ;
2519
26- IFileVersionInfo IFileVersionInfoFactory . GetVersionInfo ( string fileName )
27- {
28- return GetVersionInfo ( fileName ) ;
29- }
30-
31- /// <inheritdoc cref="Diagnostics.FileVersionInfo.GetVersionInfo(string)" />
32- public static IFileVersionInfo GetVersionInfo ( string fileName )
20+ /// <inheritdoc />
21+ public IFileVersionInfo GetVersionInfo ( string fileName )
3322 {
3423 MockFileData mockFileData = mockFileSystem . GetFile ( fileName ) ;
3524
Original file line number Diff line number Diff line change 1- using System ;
2- using System . Collections . Generic ;
3- using System . Linq ;
4- using System . Text ;
5- using System . Threading . Tasks ;
6-
7- namespace System . IO . Abstractions
1+ namespace System . IO . Abstractions
82{
93#if FEATURE_SERIALIZABLE
104 [ Serializable ]
@@ -22,16 +16,11 @@ public FileVersionInfoFactory(IFileSystem fileSystem)
2216 /// <inheritdoc />
2317 public IFileSystem FileSystem => fileSystem ;
2418
25- IFileVersionInfo IFileVersionInfoFactory . GetVersionInfo ( string fileName )
26- {
27- return GetVersionInfo ( fileName ) ;
28- }
29-
30- /// <inheritdoc cref="Diagnostics.FileVersionInfo.GetVersionInfo(string)" />
31- public static IFileVersionInfo GetVersionInfo ( string fileName )
19+ /// <inheritdoc />
20+ public IFileVersionInfo GetVersionInfo ( string fileName )
3221 {
3322 Diagnostics . FileVersionInfo fileVersionInfo = Diagnostics . FileVersionInfo . GetVersionInfo ( fileName ) ;
34-
23+
3524 return new FileVersionInfoWrapper ( fileVersionInfo ) ;
3625 }
3726 }
You can’t perform that action at this time.
0 commit comments