Пример #1
0
        public void TestRealNull()
        {
            const string myFileName = "real_null.bcp";

            WriteReal(null, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #2
0
        public void TestIntNull()
        {
            const string myFileName = "int_null.bcp";

            WriteInt(null, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #3
0
        public void TestText()
        {
            const string myFileName = "text.bcp";

            WriteText("KIKOO éùà", myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #4
0
        public void TestNVarChar50Null()
        {
            const string myFileName = "nvarchar(50)_null.bcp";

            WriteNVarChar(null, 50, myFileName);
            BCPTests.CheckFile(myFileName);
        }
        public void TestUniqueIdentifierNull()
        {
            const string myFileName = "uniqueidentifier_null.bcp";

            WriteUniqueIdentifier(null, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #6
0
        public void TestXml()
        {
            const string myFileName = "xml.bcp";

            WriteXml("<content>KIKOO</content>", myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #7
0
        public void TestTextNull()
        {
            const string myFileName = "text_null.bcp";

            WriteText(null, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #8
0
        public void TestDateTime2Null()
        {
            const string myFileName = "datetime2_null.bcp";

            WriteDateTime2(null, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #9
0
        public void TestVarCharMaxEmpty()
        {
            const string myFileName = "varchar(max)_empty.bcp";

            WriteVarChar("", SQLVarChar.MAX, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #10
0
        public void TestVarCharMaxNull()
        {
            const string myFileName = "varchar(max)_null.bcp";

            WriteVarChar(null, SQLVarChar.MAX, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #11
0
        public void TestTimeNull()
        {
            const string myFileName = "time_null.bcp";

            WriteTime(null, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #12
0
        public void TestVarCharMax()
        {
            const string myFileName = "varchar(max).bcp";

            WriteVarChar("KIKOO", SQLVarChar.MAX, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #13
0
        public void Test0Columns()
        {
            const string myFileName = "0columns.bcp";

            BCPWriter writer = new BCPWriter {
                Mode = BCPWriter.BackendMode.Debug
            };

            List <object> rows = new List <object>();

            rows.Add("Frédéric François");
            rows.Add("Chopin");
            rows.Add(1810);
            rows.Add(1849);

            try
            {
                BinaryWriter stream = BCPTests.CreateBinaryFile(myFileName);
                writer.WriteRows(stream, rows);
                stream.Close();
            }
            catch (ArgumentException)
            {
            }
        }
Пример #14
0
        public void TestTextEmpty()
        {
            const string myFileName = "text_empty.bcp";

            WriteText("", myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #15
0
        public void TestNVarChar50()
        {
            const string myFileName = "nvarchar(50).bcp";

            WriteNVarChar("KIKOO", 50, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #16
0
        private static void WriteReal(float?value, string myFileName)
        {
            BinaryWriter writer = BCPTests.CreateBinaryFile(myFileName);

            SQLReal.Write(writer, value);

            writer.Close();
        }
Пример #17
0
        private static void WriteTime(DateTime?time, string myFileName)
        {
            BinaryWriter writer = BCPTests.CreateBinaryFile(myFileName);

            SQLTime.Write(writer, time);

            writer.Close();
        }
Пример #18
0
        public void TestVarBinaryMaxEmpty()
        {
            byte[]       data       = { };
            const string myFileName = "varbinary(max)_empty.bcp";

            WriteVarBinary(data, SQLVarBinary.MAX, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #19
0
        private static void WriteText(string text, string myFileName)
        {
            BinaryWriter writer = BCPTests.CreateBinaryFile(myFileName);

            SQLText.Write(writer, text);

            writer.Close();
        }
Пример #20
0
        private static void WriteInt(int?value, string myFileName)
        {
            BinaryWriter writer = BCPTests.CreateBinaryFile(myFileName);

            SQLInt.Write(writer, value);

            writer.Close();
        }
        private static void WriteUniqueIdentifier(Guid?guid, string myFileName)
        {
            BinaryWriter writer = BCPTests.CreateBinaryFile(myFileName);

            SQLUniqueIdentifier.Write(writer, guid);

            writer.Close();
        }
Пример #22
0
        private static void WriteDateTime2(DateTime?dateTime, string myFileName)
        {
            BinaryWriter writer = BCPTests.CreateBinaryFile(myFileName);

            SQLDateTime2.Write(writer, dateTime);

            writer.Close();
        }
Пример #23
0
        public void TestIntMax()
        {
            const int value = SQLInt.MAX_VALUE;

            string myFileName = string.Format("int({0}).bcp", value);

            WriteInt(value, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #24
0
        public void TestInt1000()
        {
            const int value = 1000;

            string myFileName = string.Format("int({0}).bcp", value);

            WriteInt(value, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #25
0
        public void TestNChar4000Null()
        {
            const ushort length = 4000;

            string myFileName = string.Format("nchar({0})_null.bcp", length);

            WriteNChar(null, length, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #26
0
        public void TestNChar1000()
        {
            const ushort length = 1000;

            string myFileName = string.Format("nchar({0}).bcp", length);

            WriteNChar("KIKOO", length, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #27
0
        public void TestBinaryMaxNull()
        {
            const ushort length = SQLBinary.MAX_LENGTH;

            string myFileName = string.Format("binary({0})_null.bcp", length);

            WriteBinary(null, length, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #28
0
        public void TestBigIntMax()
        {
            const long value = 9223372036854775807;

            const string myFileName = "bigint(max).bcp";

            WriteBigInt(value, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #29
0
        public void TestDateTime2Min()
        {
            DateTime dateTime = new DateTime(0001, 01, 01, 00, 00, 00);

            const string myFileName = "datetime2_min.bcp";

            WriteDateTime2(dateTime, myFileName);
            BCPTests.CheckFile(myFileName);
        }
Пример #30
0
        public void TestReal()
        {
            const float value = 1234.5678f;

            const string myFileName = "real.bcp";

            WriteReal(value, myFileName);
            BCPTests.CheckFile(myFileName);
        }