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(); }
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(); }