Exemplo n.º 1
0
            public void TheResultIsARedirectToASummary()
            {
                var invoker = NSubstitute.Substitute.For<ICommandInvoker>();
                var controller = new StrengthController(null, invoker);
                var input = new AddStrengthInputModel { Description = "x", Notes = "y", Repetitions = 1, Weight = 2 };

                var res = controller.Add(input);
                res.ShouldBeType<RedirectToRouteResult>();
                ((RedirectToRouteResult)res).RouteValues["Controller"].ShouldEqual("Summary");
            }
Exemplo n.º 2
0
            public void TheCommandInvokerIsCalled()
            {
                var invoker = NSubstitute.Substitute.For<ICommandInvoker>();
                var controller = new StrengthController(null, invoker);
                var input = new AddStrengthInputModel { Description = "x", Notes = "y", Repetitions = 1, Weight = 2 };

                controller.Add(input);

                invoker.Received(1).Execute(Arg.Is<AddStrengthCommand>( x => x.ToAdd == input));
            }