Exemple #1
0
        public void RemovingItemNotInSiteDoesNotRemoveFromAdapter()
        {
            MockAdapter     adapter = new MockAdapter();
            UIExtensionSite site    = new UIExtensionSite(adapter);
            object          obj     = new object();

            site.Remove(obj);

            Assert.IsNull(adapter.RemovedElement);
        }
Exemple #2
0
        public void RemovingItemFromSiteRemovesItFromAdapter()
        {
            MockAdapter     adapter = new MockAdapter();
            UIExtensionSite site    = new UIExtensionSite(adapter);
            object          obj     = new object();

            site.Add(obj);
            site.Remove(obj);

            Assert.AreSame(obj, adapter.RemovedElement);
            Assert.AreEqual(0, site.Count);
        }