Example #1
0
        public async Task GivenICreateATokenForALeaseWithAnInMemoryLeaseProvider()
        {
            var leaseProvider = new InMemoryLeaseProvider();
            var policy        = this.scenarioContext.Get <LeasePolicy>();
            var lease         = await leaseProvider.AcquireAsync(policy);

            string leaseToken = leaseProvider.ToLeaseToken(lease);

            this.scenarioContext.Set(lease);
            this.scenarioContext.Set(leaseToken, "LeaseToken");
        }
Example #2
0
        public void WhenIAskAnInMemoryLeaseProviderToTokenizeTheToken()
        {
            var   lp    = new InMemoryLeaseProvider();
            Lease lease = this.scenarioContext.Get <Lease>();

            try
            {
                this.scenarioContext.Set(lp.ToLeaseToken(lease), "LeaseToken");
            }
            catch (AggregateException ex)
            {
                this.scenarioContext.Add("AggregateException", ex);
            }
            catch (Exception ex)
            {
                this.scenarioContext.Add("Exception", ex);
            }
        }