Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

41 lines
1.3 KiB
C#

// Copyright (c) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
using System.Reflection;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages.TestUtils;
using Xunit;
namespace System.Web.WebPages.Test
{
public class PreApplicationStartCodeTest
{
[Fact]
public void StartTest()
{
AppDomainUtils.RunInSeparateAppDomain(() =>
{
AppDomainUtils.SetPreAppStartStage();
PreApplicationStartCode.Start();
// Call a second time to ensure multiple calls do not cause issues
PreApplicationStartCode.Start();
Assert.False(RouteTable.Routes.RouteExistingFiles, "We should not be setting RouteExistingFiles");
Assert.Empty(RouteTable.Routes);
Assert.False(PageParser.EnableLongStringsAsResources);
string formsAuthLoginUrl = (string)typeof(FormsAuthentication).GetField("_LoginUrl", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
Assert.Null(formsAuthLoginUrl);
});
}
[Fact]
public void TestPreAppStartClass()
{
PreAppStartTestHelper.TestPreAppStartClass(typeof(PreApplicationStartCode));
}
}
}