Beispiel #1
0
        public given_created_seat_assignments()
        {
            var conferenceDao = new Mock <IConferenceDao>();

            conferenceDao.Setup(x => x.GetSeatTypeNames(It.IsAny <IEnumerable <Guid> >()))
            .Returns(seatTypes);

            var blobs = new MemoryBlobStorage();

            dao = new OrderDao(() => new ConferenceRegistrationDbContext(dbName), blobs, new JsonTextSerializer());
            sut = new SeatAssignmentsViewModelGenerator(conferenceDao.Object, blobs, new JsonTextSerializer());

            sut.Handle(new SeatAssignmentsCreated {
                SourceId = assignmentsId,
                OrderId  = orderId,
                Seats    = new[] {
                    new SeatAssignmentsCreated.SeatAssignmentInfo {
                        Position = 0, SeatType = seatTypes[0].Id
                    },
                    new SeatAssignmentsCreated.SeatAssignmentInfo {
                        Position = 1, SeatType = seatTypes[1].Id
                    }
                }
            });
        }
Beispiel #2
0
        public void when_seat_assigned_then_sets_attendee()
        {
            sut.Handle(new SeatAssigned(assignmentsId)
            {
                Position = 0,
                Attendee = new PersonalInfo {
                    Email     = "*****@*****.**",
                    FirstName = "a",
                    LastName  = "b"
                }
            });

            var dto = dao.FindOrderSeats(assignmentsId);

            Assert.Equal("*****@*****.**", dto.Seats[0].Attendee.Email);
            Assert.Equal("a", dto.Seats[0].Attendee.FirstName);
            Assert.Equal("b", dto.Seats[0].Attendee.LastName);
        }