public given_a_read_model_generator() { var blobStorage = new MemoryBlobStorage(); sut = new DraftOrderViewModelGenerator(() => new ConferenceRegistrationDbContext(dbName)); dao = new OrderDao(() => new ConferenceRegistrationDbContext(dbName), blobStorage, new JsonTextSerializer()); }
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 blobStorage = new MemoryBlobStorage(); this._sut = new DraftOrderViewModelGenerator(() => new ConferenceRegistrationDbContext(_dbName)); this._dao = new OrderDao(() => new ConferenceRegistrationDbContext(_dbName), blobStorage, new JsonTextSerializer()); System.Diagnostics.Trace.Listeners.Clear(); this._orderPlacedEvent = new OrderPlaced { SourceId = Guid.NewGuid(), ConferenceId = Guid.NewGuid(), AccessCode = "asdf", Seats = new[] { new SeatQuantity(Guid.NewGuid(), 5) }, Version = 1 }; _sut.Handle(_orderPlacedEvent); }
public given_a_read_model_generator() { var blobStorage = new MemoryBlobStorage(); this.sut = new DraftOrderViewModelGenerator(() => new ConferenceRegistrationDbContext(dbName)); this.dao = new OrderDao(() => new ConferenceRegistrationDbContext(dbName), blobStorage, new JsonTextSerializer()); }