[SetUp] public void SetUp() { _core = new TestCore(); _storage = _core.ResourceStore; _storage = _storage; _manager = new ProtocolHandlerManager(); _plugin = new MockPlugin(); }
[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)); }
[Test] public void TestHandlerResetting() { _manager.RegisterProtocolHandler("qwerty", "Simple Qwerty protocol", _plugin.Callback); _manager.Invoke("qwerty:1"); Assert.AreEqual("1", _plugin.URL); MockPlugin plugin2 = new MockPlugin(); _manager.RegisterProtocolHandler("qwerty", "Simple Qwerty protocol", plugin2.Callback); _manager.Invoke("qwerty:2"); Assert.AreEqual("1", _plugin.URL); Assert.AreEqual("2", plugin2.URL); }
public RegisterProtocolHandler(ProtocolHandlerManager manager, MockPlugin plugin) { _manager = manager; _plugin = plugin; }