Ejemplo n.º 1
0
        public void Setup()
        {
            _getResponse = Substitute.For <IRestResponse>();

            _connection = Substitute.For <IDeskApi>();
            _connection.Call(Arg.Any <string>(), Method.GET).Returns(_getResponse);
            _connection.Call(Arg.Any <IRestRequest>()).Returns(_getResponse);

            _mapper = new CompanyMapper(_connection);
        }
        public void Setup()
        {
            _getResponse = Substitute.For<IRestResponse>();

            _connection = Substitute.For<IDeskApi>();
            _connection.Call(Arg.Any<string>(), Method.GET).Returns(_getResponse);
            _connection.Call(Arg.Any<IRestRequest>()).Returns(_getResponse);

            _mapper = new CompanyMapper(_connection);
        }
        public ListResponse <Company> All(int page = 1, int perPage = 50)
        {
            var request = new RestRequest()
            {
                Resource      = "companies?page={page}&per_page={per_page}",
                Method        = Method.GET,
                RequestFormat = DataFormat.Json
            };

            request.AddUrlSegment("page", page.ToString());
            request.AddUrlSegment("per_page", perPage.ToString());
            var response = _api.Call(request);

            return(new ListResponse <Company>(response));
        }
Ejemplo n.º 4
0
        public void Setup()
        {
            getResponse = Substitute.For <IRestResponse>();

            connection = Substitute.For <IDeskApi>();
            connection.Call(Arg.Any <string>(), Method.GET).Returns(getResponse);

            mapper = new DeskApiMapper(connection);
        }
        public void Setup()
        {
            getResponse = Substitute.For<IRestResponse>();

            connection = Substitute.For<IDeskApi>();
            connection.Call(Arg.Any<string>(), Method.GET).Returns(getResponse);

            mapper = new DeskApiMapper(connection);
        }