public void TestTestConnection_Invalid()
        {
            ServerSettingsController controller = new ServerSettingsController();

            ActionResult result = controller.TestConnection("sdfsd", "3");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(ContentResult));
            ContentResult contentResult = (ContentResult)result;

            Assert.AreEqual("false", contentResult.Content);
        }
Ejemplo n.º 2
0
        public void TestTestConnection_Valid()
        {
            ServerSettingsController controller = new ServerSettingsController();

            ActionResult result = controller.TestConnection("localhost", "9000");

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(ContentResult));
            ContentResult contentResult = (ContentResult)result;

            Assert.AreEqual("true", contentResult.Content);
        }
        public void TestTestConnection_Valid()
        {
            ServerSettingsController controller = new ServerSettingsController();

            string vistaServer = ConfigurationManager.AppSettings["validServer"];
            string port        = ConfigurationManager.AppSettings["validListenerPort"];

            ActionResult result = controller.TestConnection(vistaServer, port);

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(ContentResult));
            ContentResult contentResult = (ContentResult)result;

            Assert.AreEqual("true", contentResult.Content);
        }