Esempio n. 1
0
        public void NotifyServicesOfStartupCompletion()
        {
            var systemDiagnostics = new SystemDiagnostics((p, s) => { }, null);
            var kernel = new Mock<IKernel>();
            var service = new CoreProxy(kernel.Object, systemDiagnostics);

            bool wasInvoked = false;
            service.OnStartupComplete += (s, e) => { wasInvoked = true; };

            service.Start();
            service.NotifyServicesOfStartupCompletion();

            Assert.IsTrue(wasInvoked);
        }
Esempio n. 2
0
        public void NotifyServicesOfStartupCompletion()
        {
            var systemDiagnostics = new SystemDiagnostics((p, s) => { }, null);
            var kernel            = new Mock <IKernel>();
            var service           = new CoreProxy(kernel.Object, systemDiagnostics);

            bool wasInvoked = false;

            service.OnStartupComplete += (s, e) => { wasInvoked = true; };

            service.Start();
            service.NotifyServicesOfStartupCompletion();

            Assert.IsTrue(wasInvoked);
        }
Esempio n. 3
0
        public void Shutdown()
        {
            bool wasShutdown = false;
            var kernel = new Mock<IKernel>();
            {
                kernel.Setup(k => k.Shutdown())
                    .Callback(() => wasShutdown = true);
            }

            var systemDiagnostics = new SystemDiagnostics((p, s) => { }, null);
            var service = new CoreProxy(kernel.Object, systemDiagnostics);

            service.Start();
            var task = service.Shutdown();
            task.Wait();

            Assert.IsTrue(wasShutdown);
        }
Esempio n. 4
0
        public void Shutdown()
        {
            bool wasShutdown = false;
            var  kernel      = new Mock <IKernel>();
            {
                kernel.Setup(k => k.Shutdown())
                .Callback(() => wasShutdown = true);
            }

            var systemDiagnostics = new SystemDiagnostics((p, s) => { }, null);
            var service           = new CoreProxy(kernel.Object, systemDiagnostics);

            service.Start();
            var task = service.Shutdown();

            task.Wait();

            Assert.IsTrue(wasShutdown);
        }