当前位置: 首页>>代码示例>>C#>>正文


C# SqlBytes.Write方法代码示例

本文整理汇总了C#中System.Data.SqlTypes.SqlBytes.Write方法的典型用法代码示例。如果您正苦于以下问题:C# SqlBytes.Write方法的具体用法?C# SqlBytes.Write怎么用?C# SqlBytes.Write使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Data.SqlTypes.SqlBytes的用法示例。


在下文中一共展示了SqlBytes.Write方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Write_NullBufferAndInstanceValueTest

		public void Write_NullBufferAndInstanceValueTest ()
		{
            ExceptionAssert.Throws<ArgumentNullException>(
		        delegate
		            {
		                byte [] b1 = null;
		                SqlBytes bytes = new SqlBytes();
			
		                bytes.Write (0, b1, 0, 10);
		                Assert.Fail ("#9 Should throw ArgumentNullException");
		            });
		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:12,代码来源:SqlBytesTest.cs

示例2: Write_NullBufferTest

		public void Write_NullBufferTest ()
		{
            ExceptionAssert.Throws<ArgumentNullException>(
		        delegate
		            {
		                byte [] b1 = { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42 };
		                byte [] b2 = null;
		                SqlBytes bytes = new SqlBytes (b1);
			
		                bytes.Write (0, b2, 0, 10);
		                Assert.Fail ("#8 Should throw ArgumentNullException");
		            });
		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:13,代码来源:SqlBytesTest.cs

示例3: Write_NullInstanceValueTest

		public void Write_NullInstanceValueTest ()
		{
            ExceptionAssert.Throws<SqlTypeException>(
		        delegate
		            {
		                byte [] b1 = { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42 };
		                SqlBytes bytes = new SqlBytes();
			
		                bytes.Write (0, b1, 0, 10);
		                Assert.Fail ("#9 Should throw SqlTypeException");
		            });
		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:12,代码来源:SqlBytesTest.cs

示例4: Write_InvalidCountTest1

		public void Write_InvalidCountTest1 ()
		{
            ExceptionAssert.Throws<ArgumentOutOfRangeException>(
		        delegate
		            {
		                byte [] b1 = { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42 };
		                byte [] b2 = new byte [10];
		                SqlBytes bytes = new SqlBytes (b2);
			
		                bytes.Write (0, b1, 0, (int) b1.Length+5);
		                Assert.Fail ("#6 Should throw ArgumentOutOfRangeException");
		            });
		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:13,代码来源:SqlBytesTest.cs

示例5: Write_InvalidCountTest2

		public void Write_InvalidCountTest2 ()
		{
            ExceptionAssert.Throws<SqlTypeException>(
		        delegate
		            {
		                byte [] b1 = { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42 };
		                byte [] b2 = new byte [10];
		                SqlBytes bytes = new SqlBytes (b2);
			
		                bytes.Write (8, b1, 0, (int) b1.Length);
		                Assert.Fail ("#7 Should throw SqlTypeException");
		            });
		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:13,代码来源:SqlBytesTest.cs

示例6: Write_InvalidCountTest2

        public void Write_InvalidCountTest2()
        {
            byte[] b1 = { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42 };
            byte[] b2 = new byte[10];
            SqlBytes bytes = new SqlBytes(b2);

            Assert.Throws<SqlTypeException>(() => bytes.Write(8, b1, 0, b1.Length));
        }
开发者ID:dotnet,项目名称:corefx,代码行数:8,代码来源:SqlBytesTest.cs

示例7: Write_NegativeOffsetInBufferTest

		public void Write_NegativeOffsetInBufferTest ()
		{
            ExceptionAssert.Throws<ArgumentOutOfRangeException>(
		        delegate
		            {
		                byte [] b1 = { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42 };
		                byte [] b2 = new byte [10];
		                SqlBytes bytes = new SqlBytes (b2);
			
		                bytes.Write (0, b1, -1, (int) b1.Length);
		                Assert.Fail ("#4 Should throw ArgumentOutOfRangeException");
		            });
		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:13,代码来源:SqlBytesTest.cs

示例8: Write_InvalidOffsetTest

		public void Write_InvalidOffsetTest ()
		{
			byte [] b1 = { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42 };
			byte [] b2 = new byte [10];
			SqlBytes bytes = new SqlBytes (b2);
			
			bytes.Write (bytes.Length+5, b1, 0, (int) b1.Length);
			Assert.Fail ("#3 Should throw SqlTypeException");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:9,代码来源:SqlBytesTest.cs

示例9: Write_InvalidOffsetInBufferTest

		public void Write_InvalidOffsetInBufferTest ()
		{
			byte [] b1 = { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42 };
			byte [] b2 = new byte [10];
			SqlBytes bytes = new SqlBytes (b2);
			
			bytes.Write (0, b1, b1.Length+5, (int) b1.Length);
			Assert.Fail ("#5 Should throw ArgumentOutOfRangeException");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:9,代码来源:SqlBytesTest.cs

示例10: Write_NegativeCountTest

        public void Write_NegativeCountTest()
        {
            byte[] b1 = { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42 };
            byte[] b2 = new byte[10];
            SqlBytes bytes = new SqlBytes(b2);

            Assert.Throws<ArgumentOutOfRangeException>(() => bytes.Write(0, b1, 0, -1));
        }
开发者ID:dotnet,项目名称:corefx,代码行数:8,代码来源:SqlBytesTest.cs

示例11: Write_NegativeOffsetTest

		public void Write_NegativeOffsetTest ()
		{
			byte [] b1 = { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42 };
			byte [] b2 = new byte [10];
			SqlBytes bytes = new SqlBytes (b2);
			
			bytes.Write (-1, b1, 0, (int) b1.Length);
			Assert.Fail ("#2 Should throw ArgumentOutOfRangeException");
		}
开发者ID:nlhepler,项目名称:mono,代码行数:9,代码来源:SqlBytesTest.cs

示例12: Write_NullBufferAndInstanceValueTest

        public void Write_NullBufferAndInstanceValueTest()
        {
            byte[] b1 = null;
            SqlBytes bytes = new SqlBytes();

            Assert.Throws<ArgumentNullException>(() => bytes.Write(0, b1, 0, 10));
        }
开发者ID:dotnet,项目名称:corefx,代码行数:7,代码来源:SqlBytesTest.cs

示例13: Write_NullInstanceValueTest

        public void Write_NullInstanceValueTest()
        {
            byte[] b1 = { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42 };
            SqlBytes bytes = new SqlBytes();

            Assert.Throws<SqlTypeException>(() => bytes.Write(0, b1, 0, 10));
        }
开发者ID:dotnet,项目名称:corefx,代码行数:7,代码来源:SqlBytesTest.cs

示例14: Write_NullBufferTest

        public void Write_NullBufferTest()
        {
            byte[] b1 = { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42 };
            byte[] b2 = null;
            SqlBytes bytes = new SqlBytes(b1);

            Assert.Throws<ArgumentNullException>(() => bytes.Write(0, b2, 0, 10));
        }
开发者ID:dotnet,项目名称:corefx,代码行数:8,代码来源:SqlBytesTest.cs

示例15: Write_SuccessTest2

		public void Write_SuccessTest2 ()
		{
			byte [] b1 = { 33, 34, 35, 36, 37, 38, 39, 40, 41, 42 };
			byte [] b2 = new byte [20];
			SqlBytes bytes = new SqlBytes (b2);
			
			bytes.Write (8, b1, 0, 10);
			Assert.AreEqual (bytes.Value [8], b1 [0], "#10 Should be same");
			Assert.AreEqual (bytes.Value [17], b1 [9], "#10 Should be same");
		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:10,代码来源:SqlBytesTest.cs


注:本文中的System.Data.SqlTypes.SqlBytes.Write方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。