Ejemplo n.º 1
0
        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;
            }
        }
Ejemplo n.º 2
0
        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;
            }
        }