예제 #1
0
        public void TestFromStoppedEndsAsStarted()
        {
            var service = new ServiceController() {
                Packages = new MockServicePackageManager(),
                Observer = {
                    Status = ServiceStatusType.Stopped
                },
                ServiceLoaderProxyType = typeof(MockServiceLoaderProxy)
            };

            service.UninstallPackage("id");

            Assert.AreEqual(ServiceStatusType.Started, service.Observer.Status);

            service.Dispose();
        }
예제 #2
0
        public void TestInstallDispatchedEntryStatusIsStarted()
        {
            var uninstalled = false;

            var service = new ServiceController() {
                Packages = new MockServicePackageManager() {
                    PackageInstalled = (sender, uri, packageId) => { uninstalled = true; }
                },
                Observer = {
                    Status = ServiceStatusType.Started
                },
                ServiceLoaderProxyType = typeof(MockServiceLoaderProxy)
            };

            service.UninstallPackage("id");

            Assert.IsTrue(uninstalled);

            service.Dispose();
        }