Exemplo n.º 1
0
 public virtual void TestRetrieveInstance()
 {
     SimpleListTestCase.Item item = (SimpleListTestCase.Item)RetrieveOnlyInstance(typeof(
                                                                                      SimpleListTestCase.Item));
     Assert.AreEqual(2, item.list.Count);
     Assert.AreEqual("zero", item.list[0]);
 }
Exemplo n.º 2
0
 public virtual void TestDeletion()
 {
     AssertObjectCount(typeof(SimpleListTestCase.ReferenceTypeElement), 1);
     SimpleListTestCase.Item item = (SimpleListTestCase.Item)RetrieveOnlyInstance(typeof(
                                                                                      SimpleListTestCase.Item));
     Db().Delete(item);
     AssertObjectCount(typeof(SimpleListTestCase.ReferenceTypeElement), 0);
 }
Exemplo n.º 3
0
 /// <exception cref="System.Exception"></exception>
 protected override void Store()
 {
     SimpleListTestCase.Item item = new SimpleListTestCase.Item();
     item.list = new ArrayList();
     item.list.Add("zero");
     item.list.Add(new SimpleListTestCase.ReferenceTypeElement("one"));
     Store(item);
 }
Exemplo n.º 4
0
		/// <exception cref="System.Exception"></exception>
		protected override void Store()
		{
			SimpleListTestCase.Item item = new SimpleListTestCase.Item();
			item.list = new ArrayList();
			item.list.Add("zero");
			item.list.Add(new SimpleListTestCase.ReferenceTypeElement("one"));
			Store(item);
		}
Exemplo n.º 5
0
        public virtual void TestQuery()
        {
            IQuery q = Db().Query();

            q.Constrain(typeof(SimpleListTestCase.Item));
            q.Descend("list").Constrain("zero");
            IObjectSet objectSet = q.Execute();

            Assert.AreEqual(1, objectSet.Count);
            SimpleListTestCase.Item item = (SimpleListTestCase.Item)objectSet.Next();
            Assert.AreEqual("zero", item.list[0]);
        }
Exemplo n.º 6
0
        public virtual void TestCascadingActivation()
        {
            SimpleListTestCase.Item item = (SimpleListTestCase.Item)RetrieveOnlyInstance(typeof(
                                                                                             SimpleListTestCase.Item));
            IList list = item.list;

            Assert.AreEqual(2, list.Count);
            object element = list[1];

            if (Db().IsActive(element))
            {
                Db().Deactivate(item, int.MaxValue);
                Assert.IsFalse(Db().IsActive(element));
                Db().Activate(item, int.MaxValue);
                Assert.IsTrue(Db().IsActive(element));
            }
        }