public void GivenACallAction_WhenStatusIsCompleted_ThenResponseWillBeEmpty()
        {
            var controller = new AgentController();
            var result = controller.Call("1", "completed");

            result.ExecuteResult(MockControllerContext.Object);

            Assert.That(Result.ToString(), Is.Empty);
        }
        public void GivenACallAction_WhenStatusIsDifferentThanCompleted_ThenRecordTheCallAndHangup()
        {
            var controller = new AgentController {Url = Url};
            var result = controller.Call("1", "busy");

            result.ExecuteResult(MockControllerContext.Object);

            var document = LoadXml(Result.ToString());

            Assert.That(document.SelectSingleNode("Response/Record").Attributes["action"].Value,
                Is.EqualTo("/Agent/Hangup"));
            Assert.That(document.SelectSingleNode("Response/Record").Attributes["transcribeCallback"].Value,
                Is.EqualTo("/Recording/Create?agentId=1"));
            Assert.That(document.SelectSingleNode("Response/Hangup"), Is.Not.Null);
        }
        public void GivenACallAction_WhenStatusIsDifferentThanCompleted_ThenRecordTheCallAndHangup()
        {
            var controller = new AgentController {
                Url = Url
            };
            var result = controller.Call("1", "busy");

            result.ExecuteResult(MockControllerContext.Object);

            var document = LoadXml(Result.ToString());

            Assert.That(document.SelectSingleNode("Response/Record").Attributes["action"].Value,
                        Is.EqualTo("/Agent/Hangup"));
            Assert.That(document.SelectSingleNode("Response/Record").Attributes["transcribeCallback"].Value,
                        Is.EqualTo("/Recording/Create?agentId=1"));
            Assert.That(document.SelectSingleNode("Response/Hangup"), Is.Not.Null);
        }