示例#1
0
        public void TestUI_DefaultHttpHandler_GeneratesDefaultPage()
        {
            PageInformation pageInformation = new PageInformation();

            PrivateType privateDefaultHttpHandler = new PrivateType(typeof(DefaultHttpHandler));

            privateDefaultHttpHandler.SetStaticField("_hostPath", new Lazy <string>(() =>
            {
                return("");
            }));

            try
            {
                string page = DefaultHttpHandler.GenerateDefaultPage(pageInformation);
                Assert.IsNotNull(page, "Page is expected to generate correctly");
                Assert.IsTrue(page.Length > 0, "Page is expected to contain content");
            }
            catch (Exception)
            {
                Assert.Fail("GenerateDefaultPage should not throw exceptions");
            }
        }