public async Task UpdateSchemaVersion() { // arrange IMongoCollection <Schema> schemas = _mongoResource.CreateCollection <Schema>(); IMongoCollection <SchemaVersion> versions = _mongoResource.CreateCollection <SchemaVersion>(); IMongoCollection <SchemaPublishReport> publishReports = _mongoResource.CreateCollection <SchemaPublishReport>(); IMongoCollection <PublishedSchema> publishedSchemas = _mongoResource.CreateCollection <PublishedSchema>(); var repository = new SchemaRepository( schemas, versions, publishReports, publishedSchemas); var schema = new Schema("foo", "bar"); await repository.AddSchemaAsync(schema); var schemaVersion = new SchemaVersion( schema.Id, "bar", new DocumentHash("baz", "baz", HashFormat.Hex), new[] { new Tag("a", "b", DateTime.UtcNow) }, DateTime.UtcNow); await repository.AddSchemaVersionAsync(schemaVersion); // act await repository.UpdateSchemaVersionTagsAsync( schemaVersion.Id, new[] { new Tag("a", "b", DateTime.UtcNow), new Tag("a", "c", DateTime.UtcNow) }); // assert SchemaVersion retrieved = await versions.AsQueryable() .Where(t => t.Id == schemaVersion.Id) .FirstOrDefaultAsync(); Assert.Equal(2, retrieved.Tags.Count); }