@@ -13,11 +13,9 @@ namespace ProjectedFSLib.Managed.Test
13
13
{
14
14
class Helpers
15
15
{
16
- private Process m_providerProcess ;
17
- public Process ProviderProcess { get => m_providerProcess ; set => m_providerProcess = value ; }
16
+ public Process ProviderProcess { get ; set ; }
18
17
19
- private int m_waitTimeoutInMs ;
20
- public int WaitTimeoutInMs { get => m_waitTimeoutInMs ; set => m_waitTimeoutInMs = value ; }
18
+ public int WaitTimeoutInMs { get ; set ; }
21
19
22
20
internal enum NotifyWaitHandleNames
23
21
{
@@ -34,26 +32,25 @@ internal enum NotifyWaitHandleNames
34
32
FilePreConvertToFull ,
35
33
}
36
34
37
- private List < EventWaitHandle > notificationEvents ;
38
- public List < EventWaitHandle > NotificationEvents { get => notificationEvents ; }
39
-
35
+ public List < EventWaitHandle > NotificationEvents { get ; }
36
+
40
37
public Helpers (
41
38
int waitTimeoutInMs
42
39
)
43
40
{
44
- m_waitTimeoutInMs = waitTimeoutInMs ;
41
+ WaitTimeoutInMs = waitTimeoutInMs ;
45
42
46
43
// Create the events that the notifications tests use.
47
- notificationEvents = new List < EventWaitHandle > ( ) ;
44
+ NotificationEvents = new List < EventWaitHandle > ( ) ;
48
45
foreach ( string eventName in Enum . GetNames ( typeof ( NotifyWaitHandleNames ) ) )
49
46
{
50
- notificationEvents . Add ( new EventWaitHandle ( false , EventResetMode . AutoReset , eventName ) ) ;
47
+ NotificationEvents . Add ( new EventWaitHandle ( false , EventResetMode . AutoReset , eventName ) ) ;
51
48
}
52
49
}
53
50
54
51
public void StartTestProvider ( )
55
52
{
56
- StartTestProvider ( out string sourceRoot , out string virtRoot ) ;
53
+ StartTestProvider ( out _ , out _ ) ;
57
54
}
58
55
59
56
public void StartTestProvider ( out string sourceRoot , out string virtRoot )
@@ -64,7 +61,7 @@ public void StartTestProvider(out string sourceRoot, out string virtRoot)
64
61
var providerExe = TestContext . Parameters . Get ( "ProviderExe" ) ;
65
62
66
63
// Create an event for the provider to signal once it is up and running.
67
- EventWaitHandle waitHandle = new EventWaitHandle ( false , EventResetMode . AutoReset , "ProviderTestProceed" ) ;
64
+ var waitHandle = new EventWaitHandle ( false , EventResetMode . AutoReset , "ProviderTestProceed" ) ;
68
65
69
66
// Set up the provider process and start it.
70
67
ProviderProcess = new Process ( ) ;
@@ -115,7 +112,7 @@ public void CreateRootsForTest(out string sourceName, out string virtRootName)
115
112
{
116
113
GetRootNamesForTest ( out sourceName , out virtRootName ) ;
117
114
118
- DirectoryInfo sourceInfo = new DirectoryInfo ( sourceName ) ;
115
+ var sourceInfo = new DirectoryInfo ( sourceName ) ;
119
116
if ( ! sourceInfo . Exists )
120
117
{
121
118
sourceInfo . Create ( ) ;
@@ -131,7 +128,7 @@ public string CreateVirtualFile(string fileName, string fileContent)
131
128
GetRootNamesForTest ( out string sourceRoot , out string virtRoot ) ;
132
129
133
130
string sourceFileName = Path . Combine ( sourceRoot , fileName ) ;
134
- FileInfo sourceFile = new FileInfo ( sourceFileName ) ;
131
+ var sourceFile = new FileInfo ( sourceFileName ) ;
135
132
136
133
if ( ! sourceFile . Exists )
137
134
{
@@ -162,14 +159,14 @@ public string CreateVirtualFile(string fileName)
162
159
// Returns the full path to the full file.
163
160
public string CreateFullFile ( string fileName , string fileContent )
164
161
{
165
- GetRootNamesForTest ( out string sourceRoot , out string virtRoot ) ;
162
+ GetRootNamesForTest ( out _ , out string virtRoot ) ;
166
163
167
164
string fullFileName = Path . Combine ( virtRoot , fileName ) ;
168
- FileInfo fullFile = new FileInfo ( fullFileName ) ;
165
+ var fullFile = new FileInfo ( fullFileName ) ;
169
166
170
167
if ( ! fullFile . Exists )
171
168
{
172
- DirectoryInfo ancestorPath = new DirectoryInfo ( Path . GetDirectoryName ( fullFile . FullName ) ) ;
169
+ var ancestorPath = new DirectoryInfo ( Path . GetDirectoryName ( fullFile . FullName ) ) ;
173
170
if ( ! ancestorPath . Exists )
174
171
{
175
172
ancestorPath . Create ( ) ;
@@ -193,10 +190,10 @@ public string CreateFullFile(string fileName)
193
190
194
191
public string ReadFileInVirtRoot ( string fileName )
195
192
{
196
- GetRootNamesForTest ( out string sourceRoot , out string virtRoot ) ;
193
+ GetRootNamesForTest ( out _ , out string virtRoot ) ;
197
194
198
195
string destFileName = Path . Combine ( virtRoot , fileName ) ;
199
- FileInfo destFile = new FileInfo ( destFileName ) ;
196
+ var destFile = new FileInfo ( destFileName ) ;
200
197
string fileContent ;
201
198
using ( StreamReader sr = destFile . OpenText ( ) )
202
199
{
@@ -208,7 +205,7 @@ public string ReadFileInVirtRoot(string fileName)
208
205
209
206
public FileStream OpenFileInVirtRoot ( string fileName , FileMode mode )
210
207
{
211
- GetRootNamesForTest ( out string sourceRoot , out string virtRoot ) ;
208
+ GetRootNamesForTest ( out _ , out string virtRoot ) ;
212
209
213
210
string destFileName = Path . Combine ( virtRoot , fileName ) ;
214
211
FileStream stream = File . Open ( destFileName , mode ) ;
0 commit comments