Ejemplo n.º 1
0
        public void TestWebActivatorAllStartMethodsGetCalled()
        {
            ActivationManager.Run();

            Assert.True(MyStartupCode.StartCalled);
            Assert.True(MyStartupCode.Start2Called);
            Assert.True(MyStartupCode.CallMeAfterAppStartCalled);
        }
Ejemplo n.º 2
0
 public void Init(HttpApplication context)
 {
     lock (_lock)
         if (_initializedModuleCount++ == 0)
         {
             ActivationManager.Run();
         }
 }
        public void TestWebActivatorAllStartMethodsGetCalled()
        {
            ActivationManager.Run();

            Assert.IsTrue(TestLibrary.MyStartupCode.StartCalled);
            Assert.IsTrue(TestLibrary.MyStartupCode.Start2Called);
            Assert.IsTrue(TestLibrary.MyStartupCode.CallMeAfterAppStartCalled);
            Assert.IsTrue(TestLibrary2.MyOtherStartupCode.StartCalled);
            Assert.IsTrue(TestLibrary2.MyOtherStartupCode.Start2Called);
        }
        public void TestSystemMicrosoftAndWebActivatorAssembliesAreIgnored()
        {
            ActivationManager.Run();

            // we're using reflection here to avoid changing the API just for the test
            var assemblies = (List <Assembly>) typeof(ActivationManager)
                             .GetField("_assemblies", BindingFlags.Static | BindingFlags.NonPublic)
                             .GetValue(null);

            Assert.IsFalse(assemblies.Any(a => a.GetName().Name.StartsWith("System")));
            Assert.IsFalse(assemblies.Any(a => a.GetName().Name.StartsWith("Microsoft")));
            Assert.IsFalse(assemblies.Any(a => a.GetName().Name.StartsWith("WebActivator")));
        }
 public void TestWebActivatorMethodsCalledBySpecifiedOrder()
 {
     ActivationManager.Run();
     ActivationManager.RunShutdownMethods();
     Assert.AreEqual("StartStart3OtherStartStart2OtherStart2CallMeAfterAppStartCallMeWhenAppEnds", ExecutionLogger.ExecutedOrder);
 }
Ejemplo n.º 6
0
 static Program()
 {
     ActivationManager.Run();
     Container.Bind <IConfigProvider>().To <XmlConfigProvider>().InSingletonScope();
 }