[SetUp] public void SetUp() { _core = new TestCore(); _storage = _core.ResourceStore; _storage = _storage; _manager = new ProtocolHandlerManager(); _plugin = new MockPlugin(); }
[Test] public void SetProtocolToCheckDefault() { _manager.RegisterProtocolHandler("qwerty", "Simple Qwerty protocol", _plugin.Callback); Assert.AreEqual(true, _manager.IsCheckNeeded("qwerty")); ProtocolHandlerManager.SetCheckNeeded("qwerty", false); Assert.AreEqual(false, _manager.IsCheckNeeded("qwerty")); ProtocolHandlerManager.SetCheckNeeded("qwerty", true); Assert.AreEqual(true, _manager.IsCheckNeeded("qwerty")); }
[Test] public void TestInvokeMakeDefault() { _manager.RegisterProtocolHandler("qwerty", "Simple Qwerty protocol", _plugin.Callback, _plugin.MakeDefaultCallback); IResourceList handlers = _manager.ProtocolHandlersList; Assert.AreEqual(1, handlers.Count); IResource handler = handlers[0]; ProtocolHandlerManager.SetAsDefaultHandler(handler, true); Assert.AreEqual(true, _plugin.WasSetAsDefault); }
[SetUp] public void SetUp() { _core = new TestCore(); _resourceAP = new AsyncProcessor(true); _core.SetResourceAP(_resourceAP); _storage = _core.ResourceStore; _storage = _storage; MyPalStorage.Storage.OwnerThread = _resourceAP.Thread; _manager = new ProtocolHandlerManager(); _core.SetProtocolHandlerManager(_manager); _plugin = new MockPlugin(); _resourceAP.RunJob(new MethodInvoker(RegisterResources)); }
public RegisterProtocolHandler(ProtocolHandlerManager manager, MockPlugin plugin) { _manager = manager; _plugin = plugin; }