예제 #1
0
        public void Posts_given_parameters_as_json_to_operation_action()
        {
            ModelsAre(
                Model("model")
                .Operation("action", "model", PModel("arg1", "model"))
                );

            stubber.SetUpPost(mock,
                              url: $"{URL_BASE}/model/3/action",
                              body: @"{""arg1"":""4""}",
                              response: @"{""Id"":""5"",""Display"":""Test""}"
                              );

            var actual = invoker.InvokeDo(testing, Id("3", "model"), "action",
                                          new Dictionary <string, ParameterValueData>
            {
                {
                    "arg1",
                    new ParameterValueData {
                        Values = new List <ParameterData>
                        {
                            new() { Id = "4", ModelId = "model" }
                        }
                    }
                }
            });
        public void Locates_target_object_and_performs_given_operation_via_view_model()
        {
            SetUpObject("id");

            invoker.InvokeDo(testing, Id("id"), "Void", Params());

            businessMock.Verify(o => o.Void(), Times.Once());
        }