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

              Assert.That (
              () => addInManager.GetServiceManager (handle),
              Throws.InvalidOperationException.With.Message.EqualTo (string.Format (c_documentNotRegisteredFormatString, handle)));
        }
        public void GetServiceManager_GetByDocumentHandle_ShouldSucceed()
        {
            var handle = CreateDocumentHandle();
              var addInManager = new HtmlDocumentHandleRegistry (new FakeServiceManagerFactory(), new FakeEventDispatcherFactory());

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

              Assert.That (() => addInManager.GetServiceManager (handle), Is.InstanceOf<FakeServiceManager>());
        }