Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 public void On(DeleteEvent delete)
 {
     _collection.Delete(delete, delete.AggregateId);
 }
Ejemplo n.º 6
0
 public Task On(DeleteEvent delete)
 {
     return(_collection.DeleteAsync(delete, delete.AggregateId.AsString()));
 }