/// <exception cref="System.Exception"></exception>
 public virtual void TestClose()
 {
     var container = Db();
     var session = FileSession();
     var actual = new Collection4();
     EventRegistry().Closing += new _IEventListener4_21(actual).OnEvent;
     Fixture().Close();
     if (IsEmbedded())
     {
         Iterator4Assert.AreEqual(new object[] {container, session}, actual.GetEnumerator
             ());
     }
     else
     {
         Assert.AreSame(container, actual.SingleElement());
     }
 }
		/// <exception cref="System.Exception"></exception>
		public virtual void TestClose()
		{
			IExtObjectContainer container = Db();
			LocalObjectContainer session = FileSession();
			Collection4 actual = new Collection4();
			EventRegistry().Closing += new System.EventHandler<Db4objects.Db4o.Events.ObjectContainerEventArgs>
				(new _IEventListener4_21(actual).OnEvent);
			Fixture().Close();
			if (IsEmbedded())
			{
				Iterator4Assert.AreEqual(new object[] { container, session }, actual.GetEnumerator
					());
			}
			else
			{
				Assert.AreSame(container, actual.SingleElement());
			}
		}
示例#3
0
 internal virtual IConstraint ToConstraint(Collection4 constraints)
 {
     if (constraints.Size() == 1)
     {
         return (IConstraint) constraints.SingleElement();
     }
     if (constraints.Size() > 0)
     {
         var constraintArray = new IConstraint[constraints.Size()];
         constraints.ToArray(constraintArray);
         return new QConstraints(_trans, constraintArray);
     }
     return null;
 }