Пример #1
0
 public void GetTotalsWithDefaultClientTest()
 {
     using (var server = new HttpServer(new RequestHandler
     {
         EstimatedMethod = "GET",
         EstimatedPathAndQuery = string.Format("/v1.0/accounts/{0}/inserviceNumbers/totals", Helper.AccountId),
         ContentToSend = new StringContent(TestXmlStrings.InServiceNumbersTotals, Encoding.UTF8, "application/xml")
     }))
     {
         var result = InServiceNumber.GetTotals().Result;
         if (server.Error != null)
         {
             throw server.Error;
         }
         Assert.AreEqual(3, result.Count);
     }
 }
Пример #2
0
 public void ListTest()
 {
     using (var server = new HttpServer(new RequestHandler
     {
         EstimatedMethod = "GET",
         EstimatedPathAndQuery = string.Format("/v1.0/accounts/{0}/inserviceNumbers", Helper.AccountId),
         ContentToSend = new  StringContent(TestXmlStrings.InServiceNumbers, Encoding.UTF8, "application/xml")
     }))
     {
         var client = Helper.CreateClient();
         var result = InServiceNumber.List(client).Result;
         if (server.Error != null)
         {
             throw server.Error;
         }
         Assert.AreEqual(15, result.Length);
     }
 }
Пример #3
0
        static async Task <string[]> listNumbers(Client client)
        {
            string[] activeNumbers = await InServiceNumber.List(client);

            return(activeNumbers);
        }