Esempio n. 1
0
        public void CanFindOutIfSiteIsContainedInCollection()
        {
            UIExtensionSiteCollection collection = new UIExtensionSiteCollection();

            collection.RegisterSite("Foo", new MockAdapter());

            Assert.IsTrue(collection.Contains("Foo"));
            Assert.IsFalse(collection.Contains("Foo2"));
        }
Esempio n. 2
0
        public void ContainsChecksParent()
        {
            UIExtensionSiteCollection parent = new UIExtensionSiteCollection();
            UIExtensionSiteCollection child  = new UIExtensionSiteCollection(parent);

            parent.RegisterSite("Foo", new MockAdapter());

            Assert.IsTrue(child.Contains("Foo"));
        }
Esempio n. 3
0
        public void CanUnregisterSiteCreatedWithAdapter()
        {
            UIExtensionSiteCollection collection = new UIExtensionSiteCollection();

            collection.RegisterSite("foo", new MockAdapter());
            collection.UnregisterSite("foo");

            Assert.IsFalse(collection.Contains("foo"));
        }
Esempio n. 4
0
        public void CanUnregisterSiteCreatedWithObject()
        {
            TestableRootWorkItem wi = new TestableRootWorkItem();

            wi.Services.Remove <IUIElementAdapterFactoryCatalog>();
            wi.Services.AddNew <MockFactoryCatalog, IUIElementAdapterFactoryCatalog>();
            UIExtensionSiteCollection collection = new UIExtensionSiteCollection(wi);

            collection.RegisterSite("foo", new object());
            collection.UnregisterSite("foo");

            Assert.IsFalse(collection.Contains("foo"));
        }