Exemplo n.º 1
0
        public static void MyClassCleanup()
        {
            if (_recording != null)
            {
                _recording.HangUp();
                Assert.IsFalse(_recording.IsCallConnected(), "Call not disconnected after hangup");

                _recording.Dispose();
            }
        }
Exemplo n.º 2
0
        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");
        }
Exemplo n.º 3
0
        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");
        }