Пример #1
0
        public void TestProcInsertAndDeleteOutput()
        {
            DateTime testDateTime = new DateTime(2008, 8, 8, 8, 0, 0);

            DbProxyDal.InsertProcNormal("001", long.MaxValue, int.MaxValue, short.MaxValue, byte.MaxValue, testDateTime,
                                        0.0f, 0.0, "0123456789", "0123456789", ABytes, ABytes);
            DbProxyDal.QueryProcNormalByOutput("001", out bigIntValue, out intValue, out smallIntValue, out tinyIntValue,
                                               out dateTimeValue, out realValue, out floatValue, out varcharText,
                                               out charText, out varbinaryStream, out binaryStream);
            Assert.AreEqual(long.MaxValue, bigIntValue);
            Assert.AreEqual(int.MaxValue, intValue);
            Assert.AreEqual(short.MaxValue, smallIntValue);
            Assert.AreEqual(byte.MaxValue, tinyIntValue);
            Assert.AreEqual(testDateTime, dateTimeValue);
            Assert.AreEqual(0.0f, realValue);
            Assert.AreEqual(0.0, floatValue);
            Assert.AreEqual("0123456789", varcharText);
            Assert.AreEqual("0123456789", charText);
            for (int i = 0; i < 50; i++)
            {
                Assert.AreEqual((byte)'A', varbinaryStream[i]);
                Assert.AreEqual((byte)'A', binaryStream[i]);
            }
            DbProxyDal.DeleteProc("001");
        }
Пример #2
0
        public void TestProcInsertAndDeleteScalar()
        {
            DateTime testDateTime = new DateTime(2008, 8, 8, 8, 0, 0);

            DbProxyDal.InsertProcNormal("001", long.MaxValue, int.MaxValue, short.MaxValue, byte.MaxValue, testDateTime,
                                        0.0f, 0.0, "0123456789", "0123456789", ABytes, ABytes);
            int linenum, returnValue;

            DbProxyDal.QueryProcNormalByScalar("001", out linenum, out returnValue);
            Assert.AreEqual(1, linenum);
            Assert.AreEqual(1, returnValue);
            DbProxyDal.DeleteProc("001");
        }
Пример #3
0
        public void TestProcUpdateValueNull()
        {
            DateTime testDateTime = new DateTime(2008, 8, 8, 8, 0, 0);

            DbProxyDal.InsertProcNormal("001", long.MaxValue, int.MaxValue, short.MaxValue, byte.MaxValue, testDateTime,
                                        0.0f, 0.0, "0123456789", "0123456789", ABytes, ABytes);
            DbProxyDal.UpdateProcNull("001");
            DbProxyDal.QueryProcNullByReader("001", out bigIntNull, out intNull, out smallIntNull, out tinyIntNull, out dateTimeNull,
                                             out realNull, out floatNull, out varcharNull, out charNull, out varbinaryNull,
                                             out binaryNull);
            Assert.AreEqual(true, bigIntNull);
            Assert.AreEqual(true, intNull);
            Assert.AreEqual(true, smallIntNull);
            Assert.AreEqual(true, tinyIntNull);
            Assert.AreEqual(true, dateTimeNull);
            Assert.AreEqual(true, realNull);
            Assert.AreEqual(true, floatNull);
            Assert.AreEqual(true, varcharNull);
            Assert.AreEqual(true, charNull);
            Assert.AreEqual(true, varbinaryNull);
            Assert.AreEqual(true, binaryNull);
            DbProxyDal.DeleteProc("001");
        }