public void WebContentDispatchercontainsTypeTest() { ExecuteTest(() => { WebContentDispatcher container = new WebContentDispatcher(new InMemoryContainer()); TestContentType c = TestContentType.getARandomTestContentType(enforce_a_reference: false); Assert.IsFalse(container.ContainsType <TestContentType>()); container.Add(c); Assert.IsTrue(container.ContainsType <TestContentType>()); container.Dispose(); }); }
public void WebContentDispatcherAddTest() { ExecuteTest(() => { WebContentDispatcher container = new WebContentDispatcher(new InMemoryContainer()); TestContentType c = TestContentType.getARandomTestContentType(enforce_a_reference: false); container.Add(c); Guid guid = c.guid; Assert.AreSame(c, container.GetContent <TestContentType>(guid)); container.Dispose(); return(guid.Tiny()); }); }
public void WebContentDispatcherStorageInstanceAddedOnDispose() { ExecuteTest(() => { IContentContainer storage = new InMemoryContainer(); WebContentDispatcher container = new WebContentDispatcher(storage); this.getMystery().AssemblyRegister.setGlobalObject <IContentDispatcher>(container); TestContentType c = TestContentType.getARandomTestContentTypeWithoutreference(); container.Add(c); Assert.IsFalse(storage.Contains(c)); container.Dispose(); Assert.IsTrue(storage.Contains(c)); this.getMystery().AssemblyRegister.setGlobalObject <IContentDispatcher>(null); }); }