Example #1
0
        public void WhenANewEventEOfTypeTestAggregateCreatedIsAppliedToTheAggregateWithId(string @eventName, Guid aggregateId)
        {
            var createdEvent = new TestAggregateCreatedEvent(aggregateId);

            ScenarioContext.Current.Set <IEvent>(createdEvent, @eventName);

            var aggregate = ScenarioContext.Current.Get <IAggregate>();

            CommonSteps.RunExceptionControlledStep(() => aggregate.ApplyEvent(createdEvent));
        }
Example #2
0
        public void WhenANewEventOfTypeTestAggregateOtherIsAppliedToTheAggregate(string @eventName)
        {
            var otherEvent = new TestAggregateOtherEvent();

            ScenarioContext.Current.Set <IEvent>(otherEvent, @eventName);

            var aggregate = ScenarioContext.Current.Get <IAggregate>();

            CommonSteps.RunExceptionControlledStep(() => aggregate.ApplyEvent(otherEvent));
        }
Example #3
0
        public void WhenANewEventOfTypeTestAggregateModifiedVersionTwoIsAppliedToTheAggregateWithValue(string @eventName, string value, int intValue)
        {
            var modifiedEvent = new TestAggregateModifiedEvent_V2()
            {
                Value = value, IntValue = intValue
            };

            ScenarioContext.Current.Set <IEvent>(modifiedEvent, @eventName);

            var aggregate = ScenarioContext.Current.Get <IAggregate>();

            CommonSteps.RunExceptionControlledStep(() => aggregate.ApplyEvent(modifiedEvent));
        }
Example #4
0
        public void WhenANullIsAppliedToTheAggregate()
        {
            var aggregate = ScenarioContext.Current.Get <IAggregate>();

            CommonSteps.RunExceptionControlledStep(() => aggregate.ApplyEvent(null));
        }