public async Task Should_insert_item() { // arrange var mongoEntity = new SomeMongoEntity { BsonId = "11", Name = "fqsfqfxfq1" }; // act await this.GetWriter().Insert(mongoEntity); // assert var fromDb = await this.GetKeyProvider().Get(mongoEntity.BsonId); Assert.Equal(mongoEntity.Name, fromDb.Name); }
public async Task Should_delete_item() { // arrange var entity = new SomeMongoEntity { BsonId = "BsonIdToDelete", Name = "fq112" }; await this.GetWriter().Insert(entity); // act await this.GetWriter().Delete(entity.BsonId); // assert var fromDb = await this.GetKeyProvider().Get(entity.BsonId); Assert.Null(fromDb); }
public async Task Should_update_item() { // arrange var entity = new SomeMongoEntity { BsonId = "BsonIdToUpdate", Name = "fq112" }; await this.GetWriter().Insert(entity); // act entity.Name = "r1wrd21"; await this.GetWriter().Update(entity); // assert var fromDb = await this.GetKeyProvider().Get(entity.BsonId); Assert.Equal(entity.Name, fromDb.Name); }