public void delete_is_idempotent() { var insert = new InsertEvent() { Text = "one" }; var delete = new DeleteEvent(); _projection.On(insert); _projection.On(delete); _projection.On(delete); var loaded = _collection.FindOneById(delete.AggregateId); Assert.IsNull(loaded); }
public void delete_does_not_generates_multiple_notifications() { var insert = new InsertEvent() { Text = "one" }; var delete = new DeleteEvent(); _projection.On(insert); _projection.On(delete); _projection.On(delete); var loaded = _collection.FindOneById(delete.AggregateId); Assert.AreEqual(2, SpyNotifier.Counter); }
public async Task delete_does_not_generates_multiple_notifications() { var insert = new InsertEvent() { Text = "one" }; var delete = new DeleteEvent(); await _projection.On(insert); await _projection.On(delete); await _projection.On(delete); Assert.AreEqual(2, SpyNotifier.Counter); }
public async Task delete_is_idempotent() { var insert = new InsertEvent() { Text = "one" }; var delete = new DeleteEvent(); await _projection.On(insert); await _projection.On(delete); await _projection.On(delete); var loaded = await _collection.FindOneByIdAsync(delete.AggregateId.AsString()); Assert.IsNull(loaded); }
public void On(DeleteEvent delete) { _collection.Delete(delete, delete.AggregateId); }
public Task On(DeleteEvent delete) { return(_collection.DeleteAsync(delete, delete.AggregateId.AsString())); }