コード例 #1
0
        public void TestEditGet()
        {
            ServerSettingsController controller = new ServerSettingsController();

            ActionResult result = controller.Edit();

            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(ViewResult));
            ViewResult viewResult = (ViewResult)result;

            Assert.IsInstanceOfType(viewResult.Model, typeof(ServerConfig));
            ServerConfig config = (ServerConfig)viewResult.Model;

            Assert.IsFalse(string.IsNullOrWhiteSpace(config.ServerName));
            Assert.IsTrue(config.ListenerPort > 0);
        }