public void when_creating_seat_then_adds_to_conference()
        {
            var seat = new SeatType {
                Name        = "precon",
                Description = "precon desc",
                Price       = 100,
                Quantity    = 100
            };

            service.CreateSeat(conference.Id, seat);

            var seats = service.FindSeatTypes(conference.Id);

            Assert.Equal(2, seats.Count());
        }
        public static ConferenceInfo PopulateConfereceData(Table table)
        {
            var svc        = new ConferenceService(BuildEventBus());
            var conference = BuildInternalConferenceInfo(table);

            svc.CreateConference(conference);
            svc.Publish(conference.Id);
            // publish seats
            ICollection <SeatType> createdSeats = CreateSeats(table);

            foreach (var seat in createdSeats)
            {
                svc.CreateSeat(conference.Id, seat);
            }

            var created = MessageLogHelper.CollectEvents <AvailableSeatsChanged>(conference.Id, createdSeats.Count);

            if (!created)
            {
                throw new TimeoutException("Conference creation error");
            }

            // Update the confInfo with the created seats

            conference.Seats.AddRange(createdSeats);

            return(conference);
        }
Exemple #3
0
 public void WhenTheseSeatTypesAreCreated(Table table)
 {
     seats = ConferenceHelper.CreateSeats(table);
     foreach (var seat in seats)
     {
         conferenceService.CreateSeat(conference.Id, seat);
     }
 }
        public static void CreateSeats(string conferenceSlug, Table table)
        {
            var svc        = new ConferenceService(BuildEventBus());
            var conference = FindConference(conferenceSlug);

            foreach (var row in table.Rows)
            {
                svc.CreateSeat(conference.Id, new SeatType
                {
                    Name        = row["Name"],
                    Description = row["Description"],
                    Quantity    = int.Parse(row["Quantity"]),
                    Price       = decimal.Parse(row["Price"])
                });
            }
        }
        public static ConferenceInfo PopulateConfereceData(Table table)
        {
            var svc = new ConferenceService(BuildEventBus());
            var conference = BuildInternalConferenceInfo(table);
            svc.CreateConference(conference);
            svc.Publish(conference.Id);
            // publish seats
            ICollection<SeatType> createdSeats = CreateSeats(table);
            foreach (var seat in createdSeats)
            {
                svc.CreateSeat(conference.Id, seat);
            }

            var created = MessageLogHelper.CollectEvents<AvailableSeatsChanged>(conference.Id, createdSeats.Count);

            if(!created)
                throw new TimeoutException("Conference creation error");

            // Update the confInfo with the created seats
            
            conference.Seats.AddRange(createdSeats);

            return conference;
        }
        public static void CreateSeats(string conferenceSlug, Table table)
        {
            var svc = new ConferenceService(BuildEventBus());
            var conference = FindConference(conferenceSlug);

            foreach (var row in table.Rows)
            {
                svc.CreateSeat(conference.Id, new SeatType
                                            {
                                                Name = row["Name"],
                                                Description = row["Description"],
                                                Quantity = int.Parse(row["Quantity"]),
                                                Price = decimal.Parse(row["Price"])
                                            });
            }
        }
Exemple #7
0
 public void when_creating_seat_then_throws()
 {
     Assert.Throws <ObjectNotFoundException>(() => service.CreateSeat(Guid.NewGuid(), new SeatType()));
 }