Exemplo n.º 1
0
            public void AnAddStrengthCommandIsSubmitted()
            {
                var invoker = new Mock<ICommandInvoker>();
                var controller = new AddController(invoker.Object, null);
                var input = new AddStrengthInputModel {ExerciseId = 2, Notes = "f", Repetitions = 10, Weight = 185};

                var result = controller.Strength(input);

                invoker.Verify(i =>i.Execute(It.Is<AddStrengthCommand>(cmd =>
                            cmd.ExerciseId == input.ExerciseId && cmd.Notes == input.Notes &&
                            cmd.Repetitions == input.Repetitions && cmd.Weight == input.Weight)));
            }
Exemplo n.º 2
0
            public void TheUserIsRedirectedToTheWokoutSummary()
            {
                var invoker = new Mock<ICommandInvoker>();
                var controller = new AddController(invoker.Object, null);
                var input = new AddStrengthInputModel { ExerciseId = 2, Notes = "f", Repetitions = 10, Weight = 185 };

                var result = (RedirectToRouteResult)controller.Strength(input);
                result.RouteValues["action"].ShouldEqual("Index");
            }