public void DomainListOptions() { var filters = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("name_like", "example.com"), new KeyValuePair <string, string>("registrant_id", "89") }; var sorting = new KeyValuePair <string, string>("sort", "id:asc,name:asc,expires_on:desc"); var pagination = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("per_page", "42"), new KeyValuePair <string, string>("page", "7") }; var options = new DomainListOptions { Pagination = new Pagination { PerPage = 42, Page = 7 } }.FilterByName("example.com") .FilterByRegistrantId(89) .SortById(Order.asc) .SortByName(Order.asc) .SortByExpiresOn(Order.desc); Assert.Multiple(() => { Assert.AreEqual(filters, options.UnpackFilters()); Assert.AreEqual(sorting, options.UnpackSorting()); Assert.AreEqual(pagination, options.UnpackPagination()); }); }
public void ListDomainsWithOptions(string expectedUrl) { var client = new MockDnsimpleClient(ListDomainsFixture); var listOptions = new DomainListOptions(); listOptions.FilterByName("example.com"); listOptions.SortById(Order.asc); client.Domains.ListDomains(1010, listOptions); Assert.AreEqual(expectedUrl, client.RequestSentTo()); }