Exemplo n.º 1
0
        public void FindCliente()
        {
            RestAPIHelper <CreatedCliente> restAPI = new RestAPIHelper <CreatedCliente>();
            var            restURL     = restAPI.SetUrl("/api/clientes/8");
            var            restRequest = restAPI.CreateGetRequest();
            var            response    = restAPI.GetResponse(restURL, restRequest);
            CreatedCliente content     = restAPI.GetContent <CreatedCliente>(response);

            Assert.AreEqual("Test", content.nombre);
        }
Exemplo n.º 2
0
        public void CreateClientes()
        {
            string jsonString = @"{
                                 ""username"":""asdasd"",
                                 ""userpass"":""admin123"",
                                 ""nombre"":""testnombre"",
                                 ""apellidos"":""unit test"",
                                 ""email"":""*****@*****.**"",
                                 ""direccion"":""test direccion"",
                                 ""dni"":""75116591""
                                }";
            RestAPIHelper <CreatedCliente> restAPI = new RestAPIHelper <CreatedCliente>();
            var            restURL     = restAPI.SetUrl("/api/clientes/");
            var            restRequest = restAPI.CreatePostRequest(jsonString);
            var            response    = restAPI.GetResponse(restURL, restRequest);
            CreatedCliente content     = restAPI.GetContent <CreatedCliente>(response);

            Assert.AreEqual("testnombre", content.nombre);
        }