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)); }
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)); }
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)); }
public void WhenANullIsAppliedToTheAggregate() { var aggregate = ScenarioContext.Current.Get <IAggregate>(); CommonSteps.RunExceptionControlledStep(() => aggregate.ApplyEvent(null)); }