Beispiel #1
0
        public void NullableTest4(Func <DbManager, SmallDataTypeTest2, int> insert, string config)
        {
            using (var db = new TestDbManager(config))
            {
                var data = new SmallDataTypeTest2()
                {
                    Byte_    = 0,
                    Int16_   = 0,
                    Int32_   = 0,
                    Int64_   = 0,
                    UInt16_  = 0,
                    UInt32_  = 0,
                    UInt64_  = 0,
                    Decimal_ = 0,
                    Double_  = 0,
                    Money_   = 0,
                    Single_  = 0,
                    SByte_   = 0,
                };

                var id = insert(db, data);

                var list = db.GetTable <SmallDataTypeTest>().Where(_ => _.DataTypeID >= id).ToList();
                var i    = 0;
                foreach (var d2 in list)
                {
                    Console.WriteLine("Iteration: " + i++);
                    Assert.IsNull(d2.Byte_);
                    Assert.IsNull(d2.Decimal_);
                    Assert.IsNull(d2.Double_);
                    Assert.IsNull(d2.Int16_);
                    Assert.IsNull(d2.Int32_);
                    Assert.IsNull(d2.Int64_);
                    Assert.IsNull(d2.Money_);
                    Assert.IsNull(d2.Single_);

                    Assert.IsNull(d2.SByte_);
                    Assert.IsNull(d2.UInt16_);
                    Assert.IsNull(d2.UInt32_);
                    Assert.IsNull(d2.UInt64_);
                }
                db.GetTable <SmallDataTypeTest>().Delete(_ => _.DataTypeID > 2);
            }
        }
Beispiel #2
0
		public void NullableTest4(Func<DbManager, SmallDataTypeTest2, int> insert, string config)
		{
			using (var db = new TestDbManager(config))
			{

				var data = new SmallDataTypeTest2()
				{
					Byte_ = 0,
					Int16_ = 0,
					Int32_ = 0,
					Int64_ = 0,
					UInt16_ = 0,
					UInt32_ = 0,
					UInt64_ = 0,
					Decimal_ = 0,
					Double_ = 0,
					Money_ = 0,
					Single_ = 0,
					SByte_ = 0,
				};

				var id = insert(db, data);

				var list = db.GetTable<SmallDataTypeTest>().Where(_ => _.DataTypeID >= id).ToList();
				var i = 0;
				foreach (var d2 in list)
				{
					Console.WriteLine("Iteration: " + i++);
					Assert.IsNull(d2.Byte_);
					Assert.IsNull(d2.Decimal_);
					Assert.IsNull(d2.Double_);
					Assert.IsNull(d2.Int16_);
					Assert.IsNull(d2.Int32_);
					Assert.IsNull(d2.Int64_);
					Assert.IsNull(d2.Money_);
					Assert.IsNull(d2.Single_);

					Assert.IsNull(d2.SByte_);
					Assert.IsNull(d2.UInt16_);
					Assert.IsNull(d2.UInt32_);
					Assert.IsNull(d2.UInt64_);

				}
				db.GetTable<SmallDataTypeTest>().Delete(_ => _.DataTypeID > 2);
			}
		}