public void ThrowsArgumentNullExceptionWhenPassingNullContact() { SetAccountNrOfContactsCommand cmd = new SetAccountNrOfContactsCommand { FromContact = null }; Assert.ThrowsException <ArgumentNullException>(() => CmdBus.Handle(cmd, FlowArgs)); }
public override VoidEvent Execute(CommandTriggeringCommand command) { SetAccountNrOfContactsCommand childCommand = new SetAccountNrOfContactsCommand { FromContact = command.FromContact }; TriggerCommand(childCommand); return(VoidEvent); }
public void CanResolveCommandHandlerWithUserContextRepo() { ICommandBus cmdBus = new Bus(); SetAccountNrOfContactsCommand cmd = new SetAccountNrOfContactsCommand { FromContact = new Contact() }; cmdBus.Handle(cmd, FlowArgs); }
private void Execute(LocalPluginContext localContext) { Ctx.Contact targetContact = localContext.GetTarget <Ctx.Contact>(); var setAccountNrOfContactsCommand = new SetAccountNrOfContactsCommand { FromContact = targetContact }; localContext.Handle(setAccountNrOfContactsCommand); }
public void AccountsNameIsCorrectlySet() { SetAccountNrOfContactsCommand cmd = new SetAccountNrOfContactsCommand { FromContact = GetTriggeringContact() }; CmdBusWithNoEventPropagation.Handle(cmd, FlowArgs); Account account = GetTargetAccount(); Assert.AreEqual($"I have 2 contacts", account.Name); }