public void When_updating_single_event_Tests()
        {
            var chain = new EventsAdaptersCatalog();

            chain.Register(new DomainEventUpdater1());
            chain.Register(new DomainEventUpdater2());

            var balanceAggregate = new BalanceAggregate(Guid.NewGuid(), 10);

            _initialEvent = new TestEvent(balanceAggregate.Id);
            _resultEvent  = chain.Update(_initialEvent).FirstOrDefault() as TestEvent_V2;
        }
        public void When_updating_single_event_Tests()
        {
            var chain = new EventsAdaptersCatalog();

            chain.Register(new DomainEventUpdater1());
            chain.Register(new DomainEventUpdater2());

            var balanceAggregate = new BalanceAggregate(Guid.NewGuid(), 10);

            _initialEvent = new TestEvent(balanceAggregate.Id);
            _resultEvent  = chain.Update(_initialEvent).FirstOrDefault() as TestEvent_V2;
            // Event_type_was_updated()
            Assert.IsAssignableFrom <TestEvent_V2>(_resultEvent);
            //Event_id_was_remained()
            Assert.Equal(_initialEvent.SourceId, _resultEvent.SourceId);
            //Event_Field_was_remained()
            Assert.Equal(_initialEvent.Field, _resultEvent.Field3);
        }
Esempio n. 3
0
        public void When_updating_single_event_Tests()
        {
            var chain = new EventsAdaptersCatalog();

            chain.Register(new DomainEventUpdater3());
            var balanceAggregate = new BalanceAggregate(Guid.NewGuid(), 10);

            _initialEvent = new TestEvent_V2(balanceAggregate.Id);
            _resultEvent  = chain.Update(_initialEvent).OfType <TestEvent_V3>();
        }
Esempio n. 4
0
        public void When_updating_single_event_Tests()
        {
            var chain = new EventsAdaptersCatalog();

            chain.Register(new DomainEventUpdater3());
            var balanceAggregate = new BalanceAggregate(Guid.NewGuid(), 10);

            _initialEvent = new TestEvent_V2(balanceAggregate.Id);
            _resultEvent  = chain.Update(_initialEvent).OfType <TestEvent_V3>();

            //Events_type_was_updated()
            Assert.IsAssignableFrom <TestEvent_V3>(_resultEvent.FirstOrDefault());
            //All_events_were_produced()
            Assert.Equal(2, _resultEvent.Count());
            //Event_id_was_remained()
            Assert.True(_resultEvent.All(e => e.SourceId == _initialEvent.SourceId));
        }