예제 #1
0
        public void Constructor_AddServiceDuplicate_ShouldThrowInvalidOperation()
        {
            var serviceAddIn = new FakeServiceAddIn();

              var serviceManager = CreateServiceManager (new[] { serviceAddIn, serviceAddIn });
              Assert.That (() => serviceManager.LoadAddIns(), Throws.InvalidOperationException);
        }
예제 #2
0
        public void Constructor_AddSharedExternalService_ShouldSucceed()
        {
            var serviceAddIn = new FakeServiceAddIn();

              var serviceManager = CreateServiceManager (new[] { serviceAddIn });
              serviceManager.LoadAddIns();
              Assert.That (serviceManager, Is.Not.Null);
              Assert.That (serviceManager.HasService (serviceAddIn.Name), Is.True);
              Assert.That (serviceManager.GetService (serviceAddIn.Name), Is.SameAs (serviceAddIn));
        }