public async Task Can_Execute()
        {
            var aggId = "Organizations-1";

            Given(EventsFactory.CreateOrganizationRegisteredEvent(aggId));
            When(CommandsFactory.CreateCorrectOrganizationNameCommand(aggId));
            await Expect(EventsFactory.CreateOrganizationNameCorrectedEvent(aggId));
        }
Ejemplo n.º 2
0
        public async Task Can_Execute()
        {
            string aggId = "Organizations-1";

            Given();
            When(CommandsFactory.CreateRegisterOrganizationCommand(aggId));
            await Expect(EventsFactory.CreateOrganizationRegisteredEvent(aggId));
        }
Ejemplo n.º 3
0
        public async Task Is_Idempotent()
        {
            string aggId = "Organizations-1";
            var    cmd   = CommandsFactory.CreateRegisterOrganizationCommand(aggId);
            var    evt   = EventsFactory.CreateOrganizationRegisteredEvent(aggId);

            Given(evt);
            When(cmd);
            await Expect();
        }
        public async Task Correction_Is_Idempotent()
        {
            var aggregateId = "Organizations-1";

            Given(
                EventsFactory.CreateOrganizationRegisteredEvent(aggregateId),
                EventsFactory.CreateOrganizationNameCorrectedEvent(aggregateId));

            When(CommandsFactory.CreateCorrectOrganizationNameCommand(aggregateId));

            await Expect();
        }
Ejemplo n.º 5
0
        public async Task NonIdempotent_Throws_OrganizationAlreadyExists()
        {
            string aggId = "Organizations-1";
            var    cmd   = CommandsFactory.CreateRegisterOrganizationCommand(aggId);

            cmd.Address.Country = "Some other";
            var evt = EventsFactory.CreateOrganizationRegisteredEvent(aggId);

            Given(evt);
            When(cmd);
            await ExpectError("OrganizationAlreadyExists");
        }