public virtual TestResourceOperationOrResponseOfT StartLongLro(WaitUntil waitUntil, CancellationToken cancellationToken = default) { using var scope = _diagnostic.CreateScope("TestResource.StartLongLro"); scope.Start(); try { var lro = new TestResourceOperationOrResponseOfT(new TestResource(), delaySteps: 10); if (waitUntil == WaitUntil.Completed) { lro.WaitForCompletion(cancellationToken); } return(lro); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual TestResourceOperationOrResponseOfT GetLro(bool waitForCompletion, bool exceptionOnWait = false, CancellationToken cancellationToken = default) { using var scope = _diagnostic.CreateScope("TestResource.GetLro"); scope.Start(); try { var lro = new TestResourceOperationOrResponseOfT(new TestResource(), exceptionOnWait); if (waitForCompletion) { lro.WaitForCompletion(cancellationToken); } return(lro); } catch (Exception e) { scope.Failed(e); throw; } }