public void WhenManyRegistrantsSelectsTheseOrderItems(int registrants, Table table)
        {
            Func <string> worker = () =>
            {
                using (var registrant = new SelfRegistrationEndToEndWithControllersSteps())
                {
                    try
                    {
                        registrant.GivenTheSelectedOrderItems(table);
                        registrant.GivenTheRegistrantProceedToMakeTheReservation();
                        //If we get here, the reservation was successful so proceeds to payment
                        registrant.GivenTheRegistrantProceedToCheckoutPayment();
                        registrant.WhenTheRegistrantProceedToConfirmThePayment();
                        registrant.ThenTheOrderShouldBeCreatedWithTheFollowingOrderItems(table);
                    }
                    catch (AssertException e)
                    {
                        return(e.Message);
                    }
                    return(null); // all went fine so nothing to report.
                }
            };

            Task <string>[] tasks = Enumerable.Range(0, registrants).Select(i => Task.Factory.StartNew(worker)).ToArray();
            Task.WaitAll(tasks);

            results = tasks.Select(t => t.Result).ToList();
        }
        public void WhenManyRegistrantsSelectsTheseOrderItems(int registrants, Table table)
        {
            Func<string> worker = () =>
            {
                using (var registrant = new SelfRegistrationEndToEndWithControllersSteps())
                {
                    try
                    {
                        registrant.GivenTheSelectedOrderItems(table);
                        registrant.GivenTheRegistrantProceedToMakeTheReservation();
                        //If we get here, the reservation was successful so proceeds to payment
                        registrant.GivenTheRegistrantProceedToCheckoutPayment();
                        registrant.WhenTheRegistrantProceedToConfirmThePayment();
                        registrant.ThenTheOrderShouldBeCreatedWithTheFollowingOrderItems(table);
                    }
                    catch (AssertException e)
                    {
                        return e.Message;
                    }
                    return null; // all went fine so nothing to report.
                }
            };

            Task<string>[] tasks = Enumerable.Range(0, registrants).Select(i => Task.Factory.StartNew(worker)).ToArray();
            Task.WaitAll(tasks);

            results = tasks.Select(t => t.Result).ToList();
        }
예제 #3
0
 public void GivenTheseSeatTypesBecomeUnavailableBeforeTheRegistrantMakesTheReservation(Table table)
 {
     var controllerSteps = new SelfRegistrationEndToEndWithControllersSteps();
     controllerSteps.GivenTheSelectedOrderItems(table);
     controllerSteps.GivenTheRegistrantProceedToMakeTheReservation();
     controllerSteps.GivenTheRegistrantEnterTheseDetails("first", "last", "*****@*****.**");
     controllerSteps.GivenTheRegistrantProceedToCheckoutPayment();
     controllerSteps.WhenTheRegistrantProceedToConfirmThePayment();
 }
예제 #4
0
        public void GivenTheseSeatTypesBecomeUnavailableBeforeTheRegistrantMakesTheReservation(Table table)
        {
            var controllerSteps = new SelfRegistrationEndToEndWithControllersSteps();

            controllerSteps.GivenTheSelectedOrderItems(table);
            controllerSteps.GivenTheRegistrantProceedToMakeTheReservation();
            controllerSteps.GivenTheRegistrantEnterTheseDetails("first", "last", "*****@*****.**");
            controllerSteps.GivenTheRegistrantProceedToCheckoutPayment();
            controllerSteps.WhenTheRegistrantProceedToConfirmThePayment();
        }