public void UpdateOriginationSettingsTest() { string siteId = "1"; string sipPeerId = "test"; var SipPeerOriginationSettings = new SipPeerOriginationSettings { VoiceProtocol = "HTTP", HttpSettings = new HttpSettings { HttpVoiceV2AppId = "469ebbac-4459-4d98-bc19-a038960e787f" } }; using (var server = new HttpServer(new[] { new RequestHandler { EstimatedMethod = "PUT", EstimatedPathAndQuery = $"/v1.0/accounts/{Helper.AccountId}/sites/{siteId}/sippeers/{sipPeerId}/products/origination/settings", } })) { var client = Helper.CreateClient(); SipPeer.UpdateOriginationSettings(siteId, sipPeerId, SipPeerOriginationSettings).Wait(); if (server.Error != null) { throw server.Error; } } }
public void SetOriginationSettingsTest() { string siteId = "1"; string sipPeerId = "test"; var SipPeerOriginationSettings = new SipPeerOriginationSettings { VoiceProtocol = "HTTP", HttpSettings = new HttpSettings { HttpVoiceV2AppId = "469ebbac-4459-4d98-bc19-a038960e787f" } }; using (var server = new HttpServer(new[] { new RequestHandler { EstimatedMethod = "POST", EstimatedPathAndQuery = $"/v1.0/accounts/{Helper.AccountId}/sites/{siteId}/sippeers/{sipPeerId}/products/origination/settings", ContentToSend = new StringContent(TestXmlStrings.SipPeerOriginationSettingsResponse, Encoding.UTF8, "application/xml") } })) { var client = Helper.CreateClient(); var r = SipPeer.SetOriginationSettings(siteId, sipPeerId, SipPeerOriginationSettings).Result; if (server.Error != null) { throw server.Error; } Assert.IsNotNull(r.SipPeerOriginationSettings); Assert.AreEqual("HTTP", r.SipPeerOriginationSettings.VoiceProtocol); Assert.AreEqual("469ebbac-4459-4d98-bc19-a038960e787f", r.SipPeerOriginationSettings.HttpSettings.HttpVoiceV2AppId); } }