Exemple #1
0
 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();
     });
 }
Exemple #2
0
 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());
     });
 }
Exemple #3
0
        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);
            });
        }