public void Post_ModelNotValid_ThrowsApplicationException()
        {
            var restClient = Substitute.For <RestClient>();

            var client = new FakeClient(new ApiContext("token"))
            {
                Client = restClient
            };

            Assert.Throws <ApplicationException>(delegate
            {
                client.Post <Contact, FakeApiModel>("/resource", new FakeApiModel());
            });
        }
        public void Post_CallsRestClient()
        {
            var restClient = Substitute.For <RestClient>();

            var client = new FakeClient(new ApiContext("token"))
            {
                Client = restClient
            };

            client.Post <Contact, FakeApiModel>("/res", new FakeApiModel {
                Firstname = "Angelina", Lastname = "Jolie"
            });

            restClient.Received(1).Execute(Arg.Any <RestRequest>());
        }