Ejemplo n.º 1
0
        public void ShouldThrowExceptionWhenPreRequisiteCheckContainsError()
        {
            _prerequisitesChecker
            .Stub(x => x.Check(Arg <TestViewModelProviderArgument> .Is.Anything))
            .Return(new CheckResult
            {
                ContainsError = true,
                Message       = "Error"
            });

            Assert.Throws <ArgumentException>(() => _viewModelFactory.GetViewModel());
        }
Ejemplo n.º 2
0
        private CommandResult ExecuteArrangeAndAct(
            ICommandHandler <BlankSimpleTestCommand> getCommandHandlerRetVal = null,
            string commandPreHandleResult = "")
        {
            _commandHandlerProvider
            .Stub(x => x.GetCommandHandler <BlankSimpleTestCommand>())
            .Return(getCommandHandlerRetVal);

            _prerequisitesChecker
            .Stub(x => x.Check(Arg <BlankSimpleTestCommand> .Is.Anything))
            .Return(String.IsNullOrEmpty(commandPreHandleResult) ? new CheckResult() : new CheckResult()
            {
                ContainsError = true,
                Message       = commandPreHandleResult
            });

            return(_bus.Execute(new BlankSimpleTestCommand()));
        }