@@ -57,7 +57,7 @@ public JobPartPlanHeader Plan
5757
5858 public Dictionary < string , Job > Jobs { get ; set ; } = new ( ) ;
5959
60- public Task AddNewJobAsync ( string transferId , StorageResource source , StorageResource destination , CancellationToken cancellationToken = default )
60+ public virtual Task AddNewJobAsync ( string transferId , StorageResource source , StorageResource destination , CancellationToken cancellationToken = default )
6161 {
6262 CancellationHelper . ThrowIfCancellationRequested ( cancellationToken ) ;
6363 if ( Jobs . ContainsKey ( transferId ) )
@@ -71,12 +71,12 @@ public Task AddNewJobAsync(string transferId, StorageResource source, StorageRes
7171 Operation = JobPlanOperation . Upload , // TODO
7272 Source = source ,
7373 Destination = destination ,
74- Status = new ( )
74+ Status = new ( DataTransferState . Queued , false , false ) ,
7575 } ;
7676 return Task . CompletedTask ;
7777 }
7878
79- public Task AddNewJobPartAsync ( string transferId , int partNumber , JobPartPlanHeader header , CancellationToken cancellationToken = default )
79+ public virtual Task AddNewJobPartAsync ( string transferId , int partNumber , JobPartPlanHeader header , CancellationToken cancellationToken = default )
8080 {
8181 CancellationHelper . ThrowIfCancellationRequested ( cancellationToken ) ;
8282 if ( ! Jobs . TryGetValue ( transferId , out Job job ) )
@@ -90,18 +90,18 @@ public Task AddNewJobPartAsync(string transferId, int partNumber, JobPartPlanHea
9090 job . Parts . Add ( partNumber , new ( )
9191 {
9292 Plan = header ,
93- Status = new ( )
93+ Status = new ( DataTransferState . Queued , false , false ) ,
9494 } ) ;
9595 return Task . CompletedTask ;
9696 }
9797
98- public Task < int > GetCurrentJobPartCountAsync ( string transferId , CancellationToken cancellationToken = default )
98+ public virtual Task < int > GetCurrentJobPartCountAsync ( string transferId , CancellationToken cancellationToken = default )
9999 {
100100 CancellationHelper . ThrowIfCancellationRequested ( cancellationToken ) ;
101101 return Task . FromResult ( Jobs . TryGetValue ( transferId , out Job job ) ? job . Parts . Count : 0 ) ;
102102 }
103103
104- public Task < DataTransferProperties > GetDataTransferPropertiesAsync ( string transferId , CancellationToken cancellationToken = default )
104+ public virtual Task < DataTransferProperties > GetDataTransferPropertiesAsync ( string transferId , CancellationToken cancellationToken = default )
105105 {
106106 CancellationHelper . ThrowIfCancellationRequested ( cancellationToken ) ;
107107 if ( ! Jobs . TryGetValue ( transferId , out Job job ) )
@@ -119,7 +119,7 @@ public Task<DataTransferProperties> GetDataTransferPropertiesAsync(string transf
119119 } ) ;
120120 }
121121
122- public Task < JobPartPlanHeader > GetJobPartAsync ( string transferId , int partNumber , CancellationToken cancellationToken = default )
122+ public virtual Task < JobPartPlanHeader > GetJobPartAsync ( string transferId , int partNumber , CancellationToken cancellationToken = default )
123123 {
124124 CancellationHelper . ThrowIfCancellationRequested ( cancellationToken ) ;
125125 if ( ! Jobs . TryGetValue ( transferId , out Job job ) )
@@ -133,7 +133,7 @@ public Task<JobPartPlanHeader> GetJobPartAsync(string transferId, int partNumber
133133 return Task . FromResult ( part . Plan ) ;
134134 }
135135
136- public Task < DataTransferStatus > GetJobStatusAsync ( string transferId , CancellationToken cancellationToken = default )
136+ public virtual Task < DataTransferStatus > GetJobStatusAsync ( string transferId , CancellationToken cancellationToken = default )
137137 {
138138 CancellationHelper . ThrowIfCancellationRequested ( cancellationToken ) ;
139139 if ( ! Jobs . TryGetValue ( transferId , out Job job ) )
@@ -143,19 +143,19 @@ public Task<DataTransferStatus> GetJobStatusAsync(string transferId, Cancellatio
143143 return Task . FromResult ( job . Status . DeepCopy ( ) ) ;
144144 }
145145
146- public Task < List < string > > GetStoredTransfersAsync ( CancellationToken cancellationToken = default )
146+ public virtual Task < List < string > > GetStoredTransfersAsync ( CancellationToken cancellationToken = default )
147147 {
148148 CancellationHelper . ThrowIfCancellationRequested ( cancellationToken ) ;
149149 return Task . FromResult ( Jobs . Keys . ToList ( ) ) ;
150150 }
151151
152- public Task < bool > IsEnumerationCompleteAsync ( string transferId , CancellationToken cancellationToken = default )
152+ public virtual Task < bool > IsEnumerationCompleteAsync ( string transferId , CancellationToken cancellationToken = default )
153153 {
154154 CancellationHelper . ThrowIfCancellationRequested ( cancellationToken ) ;
155155 return Task . FromResult ( Jobs . TryGetValue ( transferId , out Job job ) && job . EnumerationComplete ) ;
156156 }
157157
158- public Task SetEnumerationCompleteAsync ( string transferId , CancellationToken cancellationToken = default )
158+ public virtual Task SetEnumerationCompleteAsync ( string transferId , CancellationToken cancellationToken = default )
159159 {
160160 CancellationHelper . ThrowIfCancellationRequested ( cancellationToken ) ;
161161 if ( Jobs . TryGetValue ( transferId , out Job job ) )
@@ -165,7 +165,7 @@ public Task SetEnumerationCompleteAsync(string transferId, CancellationToken can
165165 return Task . CompletedTask ;
166166 }
167167
168- public Task SetJobPartStatusAsync ( string transferId , int partNumber , DataTransferStatus status , CancellationToken cancellationToken = default )
168+ public virtual Task SetJobPartStatusAsync ( string transferId , int partNumber , DataTransferStatus status , CancellationToken cancellationToken = default )
169169 {
170170 CancellationHelper . ThrowIfCancellationRequested ( cancellationToken ) ;
171171 if ( Jobs . TryGetValue ( transferId , out Job job ) && job . Parts . TryGetValue ( partNumber , out JobPart part ) )
@@ -175,7 +175,7 @@ public Task SetJobPartStatusAsync(string transferId, int partNumber, DataTransfe
175175 return Task . CompletedTask ;
176176 }
177177
178- public Task SetJobStatusAsync ( string transferId , DataTransferStatus status , CancellationToken cancellationToken = default )
178+ public virtual Task SetJobStatusAsync ( string transferId , DataTransferStatus status , CancellationToken cancellationToken = default )
179179 {
180180 CancellationHelper . ThrowIfCancellationRequested ( cancellationToken ) ;
181181 if ( Jobs . TryGetValue ( transferId , out Job job ) )
@@ -185,7 +185,7 @@ public Task SetJobStatusAsync(string transferId, DataTransferStatus status, Canc
185185 return Task . CompletedTask ;
186186 }
187187
188- public Task < bool > TryRemoveStoredTransferAsync ( string transferId , CancellationToken cancellationToken = default )
188+ public virtual Task < bool > TryRemoveStoredTransferAsync ( string transferId , CancellationToken cancellationToken = default )
189189 {
190190 CancellationHelper . ThrowIfCancellationRequested ( cancellationToken ) ;
191191 return Task . FromResult ( Jobs . Remove ( transferId ) ) ;
0 commit comments