public void GetDetailsTest() { using (var server = new HttpServer(new RequestHandler { EstimatedMethod = "GET", EstimatedPathAndQuery = string.Format("/v1.0/tns/1234/tndetails", Helper.AccountId), ContentToSend = new StringContent(TestXmlStrings.TnDetailsResponse, Encoding.UTF8, "application/xml") })) { var client = Helper.CreateClient(); var tn = new Tn { TelephoneNumber = "1234", Client = client }; var result = tn.GetDetails().Result; if (server.Error != null) throw server.Error; Assert.AreEqual("9500149", result.AccountId); Assert.AreEqual("DENVER", result.City); Assert.AreEqual("656", result.Lata); Assert.AreEqual("CO", result.State); Assert.AreEqual("1234", result.FullNumber); Assert.AreEqual("0", result.Tier); Assert.AreEqual("49", result.VendorId); Assert.AreEqual("9500149", result.AccountId); } }
public void GetSitesTest() { using (var server = new HttpServer(new RequestHandler { EstimatedMethod = "GET", EstimatedPathAndQuery = string.Format("/v1.0/tns/1234/sites", Helper.AccountId), ContentToSend = new StringContent(TestXmlStrings.TnSitesResponse, Encoding.UTF8, "application/xml") })) { var client = Helper.CreateClient(); var tn = new Tn {TelephoneNumber = "1234", Client = client}; var result = tn.GetSites().Result; if (server.Error != null) throw server.Error; Assert.AreEqual("1435", result.Id); Assert.AreEqual("Sales Training", result.Name); } }
public void GetRateCenterTest() { using (var server = new HttpServer(new RequestHandler { EstimatedMethod = "GET", EstimatedPathAndQuery = string.Format("/v1.0/tns/1234/ratecenter", Helper.AccountId), ContentToSend = new StringContent(TestXmlStrings.TnRateCenterResponse, Encoding.UTF8, "application/xml") })) { var client = Helper.CreateClient(); var tn = new Tn { TelephoneNumber = "1234", Client = client }; var result = tn.GetRateCenter().Result; if (server.Error != null) throw server.Error; Assert.AreEqual("CO", result.State); Assert.AreEqual("DENVER", result.RateCenter); } }