Esempio n. 1
0
 /// <summary>
 /// Method throw
 /// </summary>
 /// <param name="request"></param>
 /// <param name="token"></param>
 /// <returns></returns>
 public Task <TestResponse> TestMethodThrow(TestRequest request, CancellationToken token = default)
 {
     Interlocked.Exchange(ref _createCount, 0);
     throw new System.NotImplementedException();
 }
Esempio n. 2
0
 /// <summary>
 /// Timeout method
 /// </summary>
 /// <param name="request"></param>
 /// <param name="token"></param>
 /// <returns></returns>
 public Task <TestResponse> TestMethodTimeout(TestRequest request, CancellationToken token = default)
 {
     Interlocked.Exchange(ref _createCount, 0);
     Task.Delay(5 * 60 * 1000, token).GetAwaiter().GetResult();
     return(Task.FromResult <TestResponse>(null));
 }
Esempio n. 3
0
 /// <summary>
 /// Method success
 /// </summary>
 /// <param name="request"></param>
 /// <param name="token"></param>
 /// <returns></returns>
 public Task <TestResponse> TestMethodSuccess(TestRequest request, CancellationToken token = default)
 {
     return(Task.FromResult(new TestResponse {
         Id = request.Id, ConstructorInvokeCount = _createCount
     }));
 }