public async Task UpdatePublishReport() { // arrange IMongoCollection <Schema> schemas = _mongoResource.CreateCollection <Schema>(); IMongoCollection <SchemaVersion> versions = _mongoResource.CreateCollection <SchemaVersion>(); IMongoCollection <SchemaPublishReport> publishReports = _mongoResource.CreateCollection <SchemaPublishReport>(); var initial = new Schema("foo", "bar"); await schemas.InsertOneAsync(initial, options : null, default); var initialVersion = new SchemaVersion( initial.Id, "foo", DocumentHash.FromSourceText("bar"), Array.Empty <Tag>(), DateTime.UtcNow); await versions.InsertOneAsync(initialVersion, options : null, default); var initialReport = new SchemaPublishReport( initialVersion.Id, Guid.NewGuid(), Array.Empty <Issue>(), PublishState.Published, DateTime.UtcNow); await publishReports.InsertOneAsync(initialReport, options : null, default); var repository = new SchemaRepository(schemas, versions, publishReports); // act await repository.UpdatePublishReportAsync(new SchemaPublishReport( initialReport.Id, initialReport.SchemaVersionId, initialReport.EnvironmentId, initialReport.Issues, PublishState.Rejected, DateTime.UtcNow)); // assert IReadOnlyDictionary <Guid, SchemaPublishReport> retrieved = await repository.GetPublishReportsAsync(new[] { initialReport.Id }); Assert.Equal(PublishState.Rejected, retrieved[initialReport.Id].State); }