示例#1
0
 [SetUp] public void SetUp()
 {
     _core    = new TestCore();
     _storage = _core.ResourceStore;
     _storage = _storage;
     _manager = new ProtocolHandlerManager();
     _plugin  = new MockPlugin();
 }
示例#2
0
 [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));
 }
示例#3
0
        [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);
        }
示例#4
0
 public RegisterProtocolHandler(ProtocolHandlerManager manager, MockPlugin plugin)
 {
     _manager = manager;
     _plugin  = plugin;
 }