public void TestMergeMessageWithParametersCallsMerge() { var merged = false; var service = new ServiceController() { Settings = { ServiceUpdateCore = false }, Packages = new MockServicePackageManager() { PackageInstalled = (sender, uri, packageId) => { merged = true; } } }; service.SignalMessage(new ServiceMessage() { Name = "merge", Arguments = new Dictionary<string, string>() { { "uri", "localhost" }, { "packageid", "id" } } }); Assert.IsTrue(merged); service.Dispose(); }
public void TestJunkMessageReturnsFalse() { var service = new ServiceController(); Assert.IsFalse(service.SignalMessage(new ServiceMessage() { Name = "junk" })); service.Dispose(); }
public void TestHelpMessageReturnsTrue() { var service = new ServiceController(); Assert.IsTrue(service.SignalMessage(new ServiceMessage() { Name = "help" })); service.Dispose(); }
public void TestMergeMessageReturnsTrue() { var service = new ServiceController() { Settings = { ServiceUpdateCore = false } }; Assert.IsTrue(service.SignalMessage(new ServiceMessage() { Name = "merge" })); service.Dispose(); }
public void TestSignalBeginCallback() { var signaled = false; var service = new ServiceController() { Settings = { ServiceUpdateCore = false }, SignalBegin = (controller, message) => signaled = true }; service.SignalMessage(new ServiceMessage() { Name = "help" }); Assert.IsTrue(signaled); service.Dispose(); }
public void TestNullMessageReturnsFalse() { var service = new ServiceController(); Assert.IsFalse(service.SignalMessage(null)); service.Dispose(); }
public void TestStatisticsMessageReturnsTrue() { var service = new ServiceController(); Assert.IsTrue(service.SignalMessage(new ServiceMessage() { Name = "statistics" })); service.Dispose(); }
public void TestSignalParameterError() { var error = false; var service = new ServiceController() { Settings = { ServiceUpdateCore = false }, SignalParameterError = (controller, list) => error = true }; service.SignalMessage(new ServiceMessage() { Name = "merge", Arguments = new Dictionary<string, string>() { { "uri", "localhost" } } }); Assert.IsTrue(error); service.Dispose(); }