예제 #1
0
        public void NullableTest(Func <DbManager, SmallDataTypeTest, int> insert, string config)
        {
            using (var db = new TestDbManager(config))
            {
                var data = new SmallDataTypeTest()
                {
                    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.IsNotNull(d2.Byte_);
                    Assert.IsNotNull(d2.Decimal_);
                    Assert.IsNotNull(d2.Double_);
                    Assert.IsNotNull(d2.Int16_);
                    Assert.IsNotNull(d2.Int32_);
                    Assert.IsNotNull(d2.Int64_);
                    Assert.IsNotNull(d2.Money_);
                    Assert.IsNotNull(d2.Single_);

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

				var data = new SmallDataTypeTest()
				{
					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.IsNotNull(d2.Byte_);
					Assert.IsNotNull(d2.Decimal_);
					Assert.IsNotNull(d2.Double_);
					Assert.IsNotNull(d2.Int16_);
					Assert.IsNotNull(d2.Int32_);
					Assert.IsNotNull(d2.Int64_);
					Assert.IsNotNull(d2.Money_);
					Assert.IsNotNull(d2.Single_);

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

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