public void GetTns2WithXmlTest()
 {
     using (var server = new HttpServer(new RequestHandler
     {
         EstimatedMethod = "GET",
         EstimatedPathAndQuery = string.Format("/v1.0/accounts/{0}/sites/1/sippeers/10/tns", Helper.AccountId),
         ContentToSend = new StringContent(TestXmlStrings.ValidSipPeerTnsResponseXml, Encoding.UTF8, "application/xml")
     }))
     {
         var client = Helper.CreateClient();
         var peer = new SipPeer
         {
             Id = "10",
             SiteId = "1"
         };
         peer.SetClient(client);
         var result = peer.GetTns().Result;
         if (server.Error != null) throw server.Error;
         Assert.AreEqual(17, result.Length);
         Assert.AreEqual("3034162216", result[0].FullNumber);
         Assert.AreEqual("3034162218", result[1].FullNumber);
     }
 }
 public void GetTnsTest()
 {
     var item = new SipPeerTelephoneNumber
     {
         FullNumber = "Number",
         RewriteUser = "******"
     };
     var response = new SipPeerTelephoneNumberResponse
     {
         SipPeerTelephoneNumber = item
     };
     using (var server = new HttpServer(new RequestHandler
     {
         EstimatedMethod = "GET",
         EstimatedPathAndQuery = string.Format("/v1.0/accounts/{0}/sites/1/sippeers/10/tns/00", Helper.AccountId),
         ContentToSend = Helper.CreateXmlContent(response)
     }))
     {
         var client = Helper.CreateClient();
         var peer = new SipPeer
         {
             Id = "10",
             SiteId = "1"
         };
         peer.SetClient(client);
         var result = peer.GetTns("00").Result;
         if (server.Error != null) throw server.Error;
         Helper.AssertObjects(item, result);
     }
 }