public async Task TheaterCreated_event_handler_creates_read_model_entity_correctly( TheaterCreated domainEvent, InMemoryTheaterRepository repositorySpy) { // Arrange var sut = new TheaterReadModelGenerator(repositorySpy); // Act await sut.Handle(new Envelope(domainEvent)); // Assert IDictionary <Guid, Theater> data = repositorySpy.Data; data.Should().ContainKey(domainEvent.TheaterId); data[domainEvent.TheaterId].Should().BeEquivalentTo(new { domainEvent.Name, domainEvent.SeatRowCount, domainEvent.SeatColumnCount, CreatedAt = domainEvent.RaisedAt, ETag = default(string), }); }
private void Handle(TheaterCreated domainEvent) { SeatRowCount = domainEvent.SeatRowCount; SeatColumnCount = domainEvent.SeatColumnCount; }