Example #1
0
        public void SetUp()
        {
            var controllerPropertiesMock = new ControllerPropertiesMock();

            _controller = new PhoneExchangeController
            {
                ControllerContext = controllerPropertiesMock.ControllerContext,
                Url = controllerPropertiesMock.Url(RouteConfig.RegisterRoutes)
            };
        }
Example #2
0
        public void GivenAShowAction_WhenTheSelectedOptionIsDifferentThan_2_Or_3_Or_4_ThenTheResponseRedirectsToIVRWelcome()
        {
            var controller = new PhoneExchangeController {
                Url = Url
            };
            var result = controller.Interconnect("*");

            result.ExecuteResult(MockControllerContext.Object);

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

            Assert.That(document.SelectSingleNode("Response/Redirect").InnerText, Is.EqualTo("/IVR/Welcome"));
        }
Example #3
0
        public void GivenAShowAction_WhenTheSelectedOptionIsEither_2_Or_3_Or_4_ThenTheResponseContainsDial(string userOption)
        {
            var controller = new PhoneExchangeController {
                Url = Url
            };
            var result = controller.Interconnect(userOption);

            result.ExecuteResult(MockControllerContext.Object);

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

            Assert.That(document.SelectSingleNode("Response/Dial"), Is.Not.Null);
            Assert.That(document.SelectSingleNode("Response/Dial").InnerText, Is.Not.Null);
            Assert.That(document.SelectSingleNode("Response/Redirect"), Is.Null);
        }