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