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(); this.dao = new OrderDao(() => new ConferenceRegistrationDbContext(dbName), blobs, new JsonTextSerializer()); this.sut = new SeatAssignmentsViewModelGenerator(conferenceDao.Object, blobs, new JsonTextSerializer()); this.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 }, } }); }
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(); this.dao = new OrderDao(() => new ConferenceRegistrationDbContext(dbName), blobs, new JsonTextSerializer()); this.sut = new SeatAssignmentsViewModelGenerator(conferenceDao.Object, blobs, new JsonTextSerializer()); this.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 }, } }); }
public void Setup() { this._dbName = this.GetType().Name + "-" + Guid.NewGuid(); using (var context = new ConferenceRegistrationDbContext(this._dbName)) { if (context.Database.Exists()) { context.Database.Delete(); } context.Database.Create(); } var conferenceDao = new Mock <IConferenceDao>(); conferenceDao.Setup(x => x.GetSeatTypeNames(It.IsAny <IEnumerable <Guid> >())) .Returns(SeatTypes); var blobs = new MemoryBlobStorage(); this.dao = new OrderDao(() => new ConferenceRegistrationDbContext(_dbName), blobs, new JsonTextSerializer()); this.sut = new SeatAssignmentsViewModelGenerator(conferenceDao.Object, blobs, new JsonTextSerializer()); this.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 }, } }); }
public OrderSeats FindOrderSeats(Guid assignmentsId) { return(FindBlob <OrderSeats>(SeatAssignmentsViewModelGenerator.GetSeatAssignmentsBlobId(assignmentsId))); }
public async Task <OrderSeats> FindOrderSeats(Guid assignmentsId) { return(await FindBlob <OrderSeats>(SeatAssignmentsViewModelGenerator.GetSeatAssignmentsBlobId(assignmentsId))); }