Exemple #1
0
        public void When_adding_non_existing_seat_type_then_adds_availability()
        {
            var seatType = Guid.NewGuid();

            _sut.AddSeats(seatType, 50);

            Assert.AreEqual(seatType, _sut.SingleEvent <AvailableSeatsChanged>().Seats.Single().SeatType);
            Assert.AreEqual(50, _sut.SingleEvent <AvailableSeatsChanged>().Seats.Single().Quantity);
        }
        public void when_adding_seat_type_then_changes_availability()
        {
            var id = Guid.NewGuid();
            var seatType = Guid.NewGuid();

            var sut = new SeatsAvailability(id);
            sut.AddSeats(seatType, 50);

            Assert.Equal(seatType, sut.SingleEvent<AvailableSeatsChanged>().Seats.Single().SeatType);
            Assert.Equal(50, sut.SingleEvent<AvailableSeatsChanged>().Seats.Single().Quantity);
        }
Exemple #3
0
        public void When_adding_seat_type_then_changes_availability()
        {
            var id       = Guid.NewGuid();
            var seatType = Guid.NewGuid();

            var seatsAvailability = new SeatsAvailability(id);

            seatsAvailability.AddSeats(seatType, 50);

            Assert.AreEqual(seatType, seatsAvailability.SingleEvent <AvailableSeatsChanged>().Seats.Single().SeatType);
            Assert.AreEqual(50, seatsAvailability.SingleEvent <AvailableSeatsChanged>().Seats.Single().Quantity);
        }
        public void InitializeDatabase(OrmRepository context)
        {
            this.innerInitializer.InitializeDatabase(context);

            // Create views, seed reference data, etc.

            // TODO: remove hardcoded seats availability.
            if (context.Set <SeatsAvailability>().Find(Guid.Empty) == null)
            {
                var availability = new SeatsAvailability(Guid.Empty);
                availability.AddSeats(50);
                context.Save(availability);
            }

            context.SaveChanges();
        }