Ejemplo n.º 1
0
        /// <summary>
        /// List all available one-click services.
        /// </summary>
        /// <param name="options">Options passed to the list (sorting and
        /// pagination).</param>
        /// <returns>A list of all the one-click services available</returns>
        /// <see>https://developer.dnsimple.com/v2/services/#listServices</see>
        public PaginatedResponse <Service> ListServices(ListServicesOptions options = null)
        {
            var builder = BuildRequestForPath(ServicesPath());

            AddListOptionsToRequest(options, ref builder);

            return(new PaginatedResponse <Service>(Execute(builder.Request)));
        }
Ejemplo n.º 2
0
        public void ListServicesWithSorting(string expectedUrl)
        {
            var client  = new MockDnsimpleClient(ListServicesFixture);
            var options = new ListServicesOptions
            {
                Pagination = new Pagination
                {
                    PerPage = 42,
                    Page    = 7
                }
            }.SortById(Order.asc)
            .SortBySid(Order.desc);

            client.Services.ListServices(options);

            Assert.AreEqual(expectedUrl, client.RequestSentTo());
        }