コード例 #1
0
        public void Test_Post_Login()
        {
            var result = new WiFiController().Login(null, 0, null, null, null, null, null, null);

            var redirectResult = Assert.IsType<RedirectResult>(result);
            Assert.False(redirectResult.Permanent);
            Assert.NotNull(redirectResult.Url);
        }
コード例 #2
0
        public void Test_Ping()
        {
            var result = new WiFiController().Ping(null, 0, 0, 0, 0);

            var contentResult = Assert.IsType<ContentResult>(result);
            Assert.NotNull(contentResult.Content);
            Assert.Equal("pong", contentResult.Content);
        }
コード例 #3
0
        public void Test_Auth()
        {
            var result = new WiFiController().Auth(null, null, null, null, 0, 0);

            var contentResult = Assert.IsType<ContentResult>(result);
            Assert.NotNull(contentResult.Content);
            Assert.Equal("auth: 1", contentResult.Content);
        }
コード例 #4
0
        public void Test_Portal()
        {
            var result = new WiFiController().Portal(null);

            var redirectResult = Assert.IsType<RedirectResult>(result);
            Assert.False(redirectResult.Permanent);
            Assert.NotNull(redirectResult.Url);
            Assert.Equal("/portal", redirectResult.Url);
        }
コード例 #5
0
        public void Test_Message()
        {
            var result = new WiFiController().Message(null);

            var viewResult = Assert.IsType<ViewResult>(result);
            Assert.Equal("Message", viewResult.ViewName);
            Assert.Null(viewResult.Model);
            Assert.NotNull(viewResult.ViewData);
        }
コード例 #6
0
        public void Test_Get_Login()
        {
            var result = new WiFiController().Login(null,0,null,null,null);

            var viewResult = Assert.IsType<ViewResult>(result);
            Assert.Null(viewResult.ViewName);
            Assert.Null(viewResult.Model);
            Assert.NotNull(viewResult.ViewData);
        }