예제 #1
0
        public void Conversions()
        {
            // ToByteArray ()
            Assert.AreEqual((byte)1, Test1.ToByteArray() [0], "#L01");
            Assert.AreEqual((byte)15, Test2.ToByteArray() [1], "#L02");

            // ToSqlBinary ()
            byte [] b = new byte [2];
            b [0] = 100;
            b [1] = 15;

            Assert.AreEqual(new SqlBinary(b), Test3.ToSqlBinary(), "#L03");

            // ToSqlString ()
            Assert.AreEqual("00000a01-0000-0000-0000-000000000000", Test1.ToSqlString().Value, "#L04");
            Assert.AreEqual("0000fafa-0000-0000-0000-000000000000", Test4.ToSqlString().Value, "#L05");

            // ToString ()
            Assert.AreEqual("00000a01-0000-0000-0000-000000000000", Test1.ToString(), "#L06");
            Assert.AreEqual("0000fafa-0000-0000-0000-000000000000", Test4.ToString(), "#L07");
        }
예제 #2
0
        public void Conversions()
        {
            // ToByteArray ()
            Assert.Equal((byte)1, _test1.ToByteArray()[0]);
            Assert.Equal((byte)15, _test2.ToByteArray()[1]);

            // ToSqlBinary ()
            byte[] b = new byte[2] {
                100, 15
            };

            Assert.Equal(new SqlBinary(b), _test3.ToSqlBinary());

            // ToSqlString ()
            Assert.Equal("00000a01-0000-0000-0000-000000000000", _test1.ToSqlString().Value);
            Assert.Equal("0000fafa-0000-0000-0000-000000000000", _test4.ToSqlString().Value);

            // ToString ()
            Assert.Equal("00000a01-0000-0000-0000-000000000000", _test1.ToString());
            Assert.Equal("0000fafa-0000-0000-0000-000000000000", _test4.ToString());
        }