Example #1
0
		/// <exception cref="System.Exception"></exception>
		public virtual void TestSimpleInstanceRetrievingWithNQWithNullBoolean()
		{
			if (!isLocal || !useSameVmOptimization)
			{
				// native must be serializable to be executed in cs mode
				return;
			}
			DeleteBase("t-simple-instance.neodatis");
			NeoDatis.Odb.ODB odb = Open("t-simple-instance.neodatis");
			TestClass tc1 = new TestClass
				();
			tc1.SetBigDecimal1(new System.Decimal(1.123456));
			tc1.SetBoolean1(true);
			tc1.SetChar1('d');
			tc1.SetDouble1(154.78998989);
			tc1.SetInt1(78964);
			tc1.SetString1("Ola chico como vc est√° ???");
			tc1.SetDate1(new System.DateTime());
			tc1.SetBoolean2(false);
			TestClass tc2 = new TestClass
				();
			tc2.SetBigDecimal1(new System.Decimal(1.1234565454));
			tc2.SetBoolean1(false);
			tc2.SetChar1('c');
			tc2.SetDouble1(78454.8779);
			tc2.SetInt1(1254);
			tc2.SetString1("Ola chico como ca va ???");
			tc2.SetDate1(new System.DateTime());
			tc2.SetBoolean2(true);
			odb.Store(tc1);
			odb.Store(tc2);
			odb.Close();
			odb = Open("t-simple-instance.neodatis");
			NeoDatis.Odb.Core.Query.IQuery q = new _SimpleNativeQuery_217();
			NeoDatis.Odb.Objects<TestClass> l = odb.GetObjects<TestClass>(q);
			TestClass tc12 = (TestClass
				)l.GetFirst();
			// println("#### " + l.size() + " : " + l);
			AssertEquals(tc1.GetBigDecimal1(), tc12.GetBigDecimal1());
			AssertEquals(tc1.GetString1(), tc12.GetString1());
			AssertEquals(tc1.GetChar1(), tc12.GetChar1());
			AssertEquals(tc1.GetDouble1(), tc12.GetDouble1());
			AssertEquals(tc1.GetInt1(), tc12.GetInt1());
			AssertEquals(tc1.IsBoolean1(), tc12.IsBoolean1());
			AssertEquals(false, tc12.GetBoolean2());
			if (l.Count < 3)
			{
				AssertEquals(tc1.GetDate1(), tc12.GetDate1());
			}
			l.Next();
			TestClass tc22 = (TestClass
				)l.Next();
			AssertEquals(tc2.GetBigDecimal1(), tc22.GetBigDecimal1());
			AssertEquals(tc2.GetString1(), tc22.GetString1());
			AssertEquals(tc2.GetChar1(), tc22.GetChar1());
			AssertEquals(tc2.GetDouble1(), tc22.GetDouble1());
			AssertEquals(tc2.GetInt1(), tc22.GetInt1());
			AssertEquals(tc2.IsBoolean1(), tc22.IsBoolean1());
			AssertEquals(true, tc2.GetBoolean2());
			if (l.Count < 3)
			{
				AssertEquals(tc2.GetDate1(), tc22.GetDate1());
			}
			odb.Close();
			DeleteBase("t-simple-instance.neodatis");
		}
Example #2
0
        /// <exception cref="System.Exception"></exception>
        public virtual void TestSimpleInstanceRetrievingWithNQWithNullBoolean()
        {
            if (!isLocal || !useSameVmOptimization)
            {
                // native must be serializable to be executed in cs mode
                return;
            }
            DeleteBase("t-simple-instance.neodatis");
            NeoDatis.Odb.ODB odb = Open("t-simple-instance.neodatis");
            TestClass        tc1 = new TestClass
                                       ();

            tc1.SetBigDecimal1(new System.Decimal(1.123456));
            tc1.SetBoolean1(true);
            tc1.SetChar1('d');
            tc1.SetDouble1(154.78998989);
            tc1.SetInt1(78964);
            tc1.SetString1("Ola chico como vc est√° ???");
            tc1.SetDate1(new System.DateTime());
            tc1.SetBoolean2(false);
            TestClass tc2 = new TestClass
                                ();

            tc2.SetBigDecimal1(new System.Decimal(1.1234565454));
            tc2.SetBoolean1(false);
            tc2.SetChar1('c');
            tc2.SetDouble1(78454.8779);
            tc2.SetInt1(1254);
            tc2.SetString1("Ola chico como ca va ???");
            tc2.SetDate1(new System.DateTime());
            tc2.SetBoolean2(true);
            odb.Store(tc1);
            odb.Store(tc2);
            odb.Close();
            odb = Open("t-simple-instance.neodatis");
            NeoDatis.Odb.Core.Query.IQuery   q = new _SimpleNativeQuery_217();
            NeoDatis.Odb.Objects <TestClass> l = odb.GetObjects <TestClass>(q);
            TestClass tc12 = (TestClass
                              )l.GetFirst();

            // println("#### " + l.size() + " : " + l);
            AssertEquals(tc1.GetBigDecimal1(), tc12.GetBigDecimal1());
            AssertEquals(tc1.GetString1(), tc12.GetString1());
            AssertEquals(tc1.GetChar1(), tc12.GetChar1());
            AssertEquals(tc1.GetDouble1(), tc12.GetDouble1());
            AssertEquals(tc1.GetInt1(), tc12.GetInt1());
            AssertEquals(tc1.IsBoolean1(), tc12.IsBoolean1());
            AssertEquals(false, tc12.GetBoolean2());
            if (l.Count < 3)
            {
                AssertEquals(tc1.GetDate1(), tc12.GetDate1());
            }
            l.Next();
            TestClass tc22 = (TestClass
                              )l.Next();

            AssertEquals(tc2.GetBigDecimal1(), tc22.GetBigDecimal1());
            AssertEquals(tc2.GetString1(), tc22.GetString1());
            AssertEquals(tc2.GetChar1(), tc22.GetChar1());
            AssertEquals(tc2.GetDouble1(), tc22.GetDouble1());
            AssertEquals(tc2.GetInt1(), tc22.GetInt1());
            AssertEquals(tc2.IsBoolean1(), tc22.IsBoolean1());
            AssertEquals(true, tc2.GetBoolean2());
            if (l.Count < 3)
            {
                AssertEquals(tc2.GetDate1(), tc22.GetDate1());
            }
            odb.Close();
            DeleteBase("t-simple-instance.neodatis");
        }