예제 #1
0
        public void containsTypeTest()
        {
            IContentContainer container = getContainer();
            TestContentType   c         = TestContentType.getARandomTestContentType(enforce_a_reference: false);

            Assert.IsFalse(container.ContainsType <TestContentType>());
            container.Add(c);
            Assert.IsTrue(container.ContainsType <TestContentType>());
        }
예제 #2
0
        public void AddTest()
        {
            IContentContainer container = getContainer();
            TestContentType   c         = TestContentType.getARandomTestContentType(enforce_a_reference: true);

            container.Add(c.single_reference.value);
            foreach (var r in c.multi_reference)
            {
                container.Add(r.value);
            }
            container.Add(c);
            Guid guid = c.guid;
            var  back_from_container = container.GetContent <TestContentType>(guid);

            Assert.AreEqual(c.guid, back_from_container.guid);
            Assert.IsTrue(c.samePropertiesValue(back_from_container));
            Assert.AreEqual(c.GetType(), back_from_container.GetType());
        }
예제 #3
0
        public void getLightContentRerefereceTest()
        {
            using (WebActionExecutor executor = new WebActionExecutor()) {
                IContentContainer container = getContainer();
                TestContentType   c         = TestContentType.getARandomTestContentType(enforce_a_reference: false);
                container.Add(c);
                LightContentReferece light_reference = container.GetLightContentRereferece <TestContentType>().FirstOrDefault();

                Assert.AreEqual(light_reference.ReferenceText, c.ReferenceText);
                Assert.AreEqual(light_reference.guid, c.guid);
            }
        }
예제 #4
0
 public void RemoveTest()
 {
     using (WebActionExecutor executor = new WebActionExecutor()) {
         IContentContainer container = getContainer();
         TestContentType   c         = TestContentType.getARandomTestContentType(enforce_a_reference: false);
         container.Add(c);
         Assert.IsTrue(container.Remove(c));
         c = TestContentType.getARandomTestContentType(enforce_a_reference: false);
         Assert.IsFalse(container.Remove(c));
         Assert.AreEqual(container.Count, 0);
     }
 }
예제 #5
0
 public void Add(IContent item)
 {
     _storage.Add(item);
 }