public static void MyClassCleanup() { if (_recording != null) { _recording.HangUp(); Assert.IsFalse(_recording.IsCallConnected(), "Call not disconnected after hangup"); _recording.Dispose(); } }
public void IsCallConnected_ErrorResponse_Failure() { _mockTransport.Setup( x => x.GetCupiResponse(It.IsAny <string>(), MethodType.GET, It.IsAny <ConnectionServerRest>(), It.IsAny <string>(), It.IsAny <bool>())).Returns(new WebCallResult { Success = false, }); Assert.IsFalse(_mockPhoneRecording.IsCallConnected(), "Phone is connected should return false with error response"); }
public new static void MyClassInitialize(TestContext testContext) { BaseIntegrationTests.MyClassInitialize(testContext); Settings mySettings = new Settings(); _extensionToDial = mySettings.ExtensionToDial; if (string.IsNullOrEmpty(_extensionToDial)) { Assert.Fail("No extension defined to run phone recording tests"); return; } try { _recording = new PhoneRecording(_connectionServer, _extensionToDial, 6); } catch (UnityConnectionRestException ex) { Assert.Fail("Phone connection failed to extension:{0}, error={1}", _extensionToDial, ex.WebCallResult); } Assert.IsTrue(_recording.IsCallConnected(), "Call not connected after class creation"); }