public async Task CreateProjectionTargetAsync_SetsEntityTenant() { Guid tenantId = Guid.Parse("7C836285-7B76-49F5-9D1D-275EA724F5FB"); var tenantEvent = new TenantAggregateRootCreated(tenantId).ToMessageDraft(); tenantEvent.SetMetadata(BasicEventMetadataNames.StreamSequenceNumber, (events.Last().Metadata.GetStreamSequenceNumber() + 1).ToString()); events.Add(tenantEvent); await sut.ProjectEventsAsync(Guid.NewGuid(), events); crudRepository.FindAllWithAdded <TestReadModel>().First().TenantId.Should().Be(tenantId); }
public async Task ProjectEventsAsync_ProjectsWithoutPrefillingData() { var tenantEvent = new TenantAggregateRootCreated(Guid.NewGuid()).ToMessageDraft(); tenantEvent.SetMetadata(BasicEventMetadataNames.StreamSequenceNumber, (events.Last().Metadata.GetStreamSequenceNumber() + 1).ToString()); events.Add(tenantEvent); await sut.ProjectEventsAsync(Guid.NewGuid(), events); crudRepository.FindAllWithAdded <TestSimpleReadModel>().Should().HaveCount(1); }