public void GetEventDispatcher_GetByDocumentHandle_ShouldSucceed()
        {
            var handle = CreateDocumentHandle();
              var addInManager = new HtmlDocumentHandleRegistry (new FakeServiceManagerFactory(), new FakeEventDispatcherFactory());

              addInManager.RegisterDocumentHandle (handle, new FakeScriptingHost());

              Assert.That (() => addInManager.GetEventDispatcher (handle), Is.InstanceOf<FakeEventDispatcher>());
        }
        public void GetEventDispatcher_DocumentHandleDoesNotExist_ShouldThrowInvalidOperation()
        {
            var handle = CreateDocumentHandle();
              var addInManager = new HtmlDocumentHandleRegistry (new FakeServiceManagerFactory(), new FakeEventDispatcherFactory());

              Assert.That (
              () => addInManager.GetEventDispatcher (handle),
              Throws.InvalidOperationException.With.Message.EqualTo (string.Format (c_documentNotRegisteredFormatString, handle)));
        }