Esempio n. 1
0
        public void TestNotWrittenWhenServiceProxyIsNull()
        {
            var signaled = false;

            var service = new ServiceController() {
                SignalBegin = (controller, message) => { signaled = true; },
                Settings = {
                    ServiceUpdateCore = false
                },
                Observer = {
                    Status = ServiceStatusType.Started
                },
                ServiceLoaderProxyType = typeof(MockServiceLoaderProxy)
            };

            service.WriteConfig_Tick(null);

            Assert.IsFalse(signaled);

            service.Dispose();
        }
Esempio n. 2
0
        public void TestWriteConfigTickPassedTroughToMessage()
        {
            var signaled = false;

            var service = new ServiceController() {
                ServiceLoaderProxy = new MockServiceLoaderProxy(),
                WriteServiceConfigBegin = (controller) => { signaled = true; },
                Settings = {
                    ServiceUpdateCore = false
                },
                Observer = {
                    Status = ServiceStatusType.Started
                },
                ServiceLoaderProxyType = typeof(MockServiceLoaderProxy)
            };

            service.WriteConfig_Tick(null);

            Assert.IsTrue(signaled);

            service.Dispose();
        }