示例#1
0
        public virtual void TestCriteriaQueryQueryWithValueInList6()
        {
            string baseName = GetBaseName();

            SetUp(baseName);
            NeoDatis.Odb.ODB odb     = Open(baseName);
            IList <string>   strings = new List
                                       <string>();
            ClassWithListOfString c = new ClassWithListOfString
                                          ("name", strings);

            c.GetStrings().Add("s1");
            c.GetStrings().Add(null);
            c.GetStrings().Add("s3");
            IList <string> strings2 = new List
                                      <string>();
            ClassWithListOfString c2 = new ClassWithListOfString
                                           ("name", null);

            odb.Store(c);
            odb.Store(c2);
            odb.Close();
            odb = Open(baseName);
            CriteriaQuery query = new CriteriaQuery
                                      (typeof(ClassWithListOfString), Where
                                      .Contain("strings", "s4"));

            NeoDatis.Odb.Objects <ClassWithListOfString> l =
                odb.GetObjects <ClassWithListOfString>(query);
            odb.Close();
            AssertEquals(0, l.Count);
        }
示例#2
0
        /// <exception cref="System.Exception"></exception>
        public virtual void TestCriteriaQueryQueryWithValueInList4()
        {
            string baseName = GetBaseName();

            NeoDatis.Odb.ODB odb = Open(baseName);
            System.Collections.Generic.IList <string> strings = new System.Collections.Generic.List
                                                                <string>();
            ClassWithListOfString c = new ClassWithListOfString
                                          ("name", strings);

            c.GetStrings().Add("s1");
            c.GetStrings().Add("s2");
            c.GetStrings().Add("s3");
            System.Collections.Generic.IList <string> strings2 = new System.Collections.Generic.List
                                                                 <string>();
            ClassWithListOfString c2 = new ClassWithListOfString
                                           ("name", strings2);

            c2.GetStrings().Add("s1");
            c2.GetStrings().Add("s2");
            c2.GetStrings().Add("s3");
            odb.Store(c);
            odb.Store(c2);
            odb.Close();
            odb = Open(baseName);
            CriteriaQuery query = new CriteriaQuery(Where.Contain("strings", "s2222"));

            NeoDatis.Odb.Objects <ClassWithListOfString> l = odb.GetObjects <ClassWithListOfString>(query);
            AssertEquals(0, l.Count);
            odb.Close();
        }
示例#3
0
        public virtual void TestCriteriaQueryQueryWithValueInList6()
		{
			string baseName = GetBaseName();
            SetUp(baseName);
			NeoDatis.Odb.ODB odb = Open(baseName);
			IList<string> strings = new List
				<string>();
			ClassWithListOfString c = new ClassWithListOfString
				("name", strings);
			c.GetStrings().Add("s1");
			c.GetStrings().Add(null);
			c.GetStrings().Add("s3");
			IList<string> strings2 = new List
				<string>();
			ClassWithListOfString c2 = new ClassWithListOfString
				("name", null);
			odb.Store(c);
			odb.Store(c2);
			odb.Close();
			odb = Open(baseName);
			CriteriaQuery query = new CriteriaQuery
				(typeof(ClassWithListOfString), Where
				.Contain("strings", "s4"));
			NeoDatis.Odb.Objects<ClassWithListOfString> l =
                odb.GetObjects <ClassWithListOfString>(query);
			odb.Close();
			AssertEquals(0, l.Count);
		}
示例#4
0
		/// <exception cref="System.Exception"></exception>
		public virtual void TestCriteriaQueryQueryWithValueInList4()
		{
			string baseName = GetBaseName();
			NeoDatis.Odb.ODB odb = Open(baseName);
			System.Collections.Generic.IList<string> strings = new System.Collections.Generic.List
				<string>();
			ClassWithListOfString c = new ClassWithListOfString
				("name", strings);
			c.GetStrings().Add("s1");
			c.GetStrings().Add("s2");
			c.GetStrings().Add("s3");
			System.Collections.Generic.IList<string> strings2 = new System.Collections.Generic.List
				<string>();
			ClassWithListOfString c2 = new ClassWithListOfString
				("name", strings2);
			c2.GetStrings().Add("s1");
			c2.GetStrings().Add("s2");
			c2.GetStrings().Add("s3");
			odb.Store(c);
			odb.Store(c2);
			odb.Close();
			odb = Open(baseName);
			CriteriaQuery query = new CriteriaQuery	(Where.Contain("strings", "s2222"));
            NeoDatis.Odb.Objects<ClassWithListOfString> l = odb.GetObjects < ClassWithListOfString>(query);
			AssertEquals(0, l.Count);
			odb.Close();
		}