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


C# SqlChars.Write方法代码示例

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


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

示例1: Write_NullInstanceValueTest

		public void Write_NullInstanceValueTest ()
		{
			char [] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
			SqlChars chars = new SqlChars();

			chars.Write (0, c1, 0, 10);
			Assert.Fail ("#9 Should throw SqlTypeException");
		}
开发者ID:LevNNN,项目名称:mono,代码行数:8,代码来源:SqlCharsTest.cs

示例2: Write_NullBufferAndInstanceValueTest

		public void Write_NullBufferAndInstanceValueTest ()
		{
			char [] c1 = null;
			SqlChars chars = new SqlChars();
			
			chars.Write (0, c1, 0, 10);
			Assert.Fail ("#9 Should throw ArgumentNullException");
		}
开发者ID:LevNNN,项目名称:mono,代码行数:8,代码来源:SqlCharsTest.cs

示例3: Write_InvalidCountTest2

		public void Write_InvalidCountTest2 ()
		{
			char [] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
			char [] c2 = new char [10];
			SqlChars chars = new SqlChars (c2);

			chars.Write (8, c1, 0, (int) c1.Length);
			Assert.Fail ("#7 Should throw SqlTypeException");
		}
开发者ID:LevNNN,项目名称:mono,代码行数:9,代码来源:SqlCharsTest.cs

示例4: Write_NullBufferTest

		public void Write_NullBufferTest ()
		{
			char [] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
			char [] c2 = null;
			SqlChars chars = new SqlChars (c1);

			chars.Write (0, c2, 0, 10);
			Assert.Fail ("#8 Should throw ArgumentNullException");
		}
开发者ID:LevNNN,项目名称:mono,代码行数:9,代码来源:SqlCharsTest.cs

示例5: Write_NegativeOffsetInBufferTest

		public void Write_NegativeOffsetInBufferTest ()
		{
			char [] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
			char [] c2 = new char [10];
			SqlChars chars = new SqlChars (c2);

			chars.Write (0, c1, -1, (int) c1.Length);
			Assert.Fail ("#4 Should throw ArgumentOutOfRangeException");
		}
开发者ID:LevNNN,项目名称:mono,代码行数:9,代码来源:SqlCharsTest.cs

示例6: Write_InvalidCountTest1

		public void Write_InvalidCountTest1 ()
		{
			char [] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
			char [] c2 = new char [10];
			SqlChars chars = new SqlChars (c2);

			chars.Write (0, c1, 0, (int) c1.Length+5);
			Assert.Fail ("#6 Should throw ArgumentOutOfRangeException");
		}
开发者ID:LevNNN,项目名称:mono,代码行数:9,代码来源:SqlCharsTest.cs

示例7: Write_NegativeCountTest

        public void Write_NegativeCountTest()
        {
            char[] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
            char[] c2 = new char[10];
            SqlChars chars = new SqlChars(c2);

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

示例8: Write_InvalidOffsetInBufferTest

		public void Write_InvalidOffsetInBufferTest ()
		{
            ExceptionAssert.Throws<ArgumentOutOfRangeException>(
		        delegate
		            {
		                char [] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
		                char [] c2 = new char [10];
		                SqlChars chars = new SqlChars (c2);

		                chars.Write (0, c1, c1.Length+5, (int) c1.Length);
		                Assert.Fail ("#5 Should throw ArgumentOutOfRangeException");
		            });
		}
开发者ID:tohosnet,项目名称:Mono.Data.Sqlite,代码行数:13,代码来源:SqlCharsTest.cs

示例9: Write_NullInstanceValueTest

        public void Write_NullInstanceValueTest()
        {
            char[] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
            SqlChars chars = new SqlChars();

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

示例10: Write_NullBufferAndInstanceValueTest

        public void Write_NullBufferAndInstanceValueTest()
        {
            char[] c1 = null;
            SqlChars chars = new SqlChars();

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

示例11: Write_NullBufferTest

        public void Write_NullBufferTest()
        {
            char[] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
            char[] c2 = null;
            SqlChars chars = new SqlChars(c1);

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

示例12: Write_InvalidCountTest2

        public void Write_InvalidCountTest2()
        {
            char[] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
            char[] c2 = new char[10];
            SqlChars chars = new SqlChars(c2);

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

示例13: Write_InvalidOffsetInBufferTest

        public void Write_InvalidOffsetInBufferTest()
        {
            char[] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
            char[] c2 = new char[10];
            SqlChars chars = new SqlChars(c2);

            Assert.Throws<ArgumentOutOfRangeException>(() => chars.Write(0, c1, c1.Length + 5, c1.Length));
        }
开发者ID:dotnet,项目名称:corefx,代码行数:8,代码来源:SqlCharsTest.cs

示例14: Write_SuccessTest2

		public void Write_SuccessTest2 ()
		{
			char [] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
			char [] c2 = new char [20];
			SqlChars chars = new SqlChars (c2);

			chars.Write (8, c1, 0, 10);
			Assert.AreEqual (chars.Value [8], c1 [0], "#10 Should be same");
			Assert.AreEqual (chars.Value [17], c1 [9], "#10 Should be same");
		}
开发者ID:LevNNN,项目名称:mono,代码行数:10,代码来源:SqlCharsTest.cs

示例15: Write_SuccessTest1

		public void Write_SuccessTest1 ()
		{
			char [] c1 = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
			char [] c2 = new char [10];
			SqlChars chars = new SqlChars (c2);

			chars.Write (0, c1, 0, (int) c1.Length);
			Assert.AreEqual (chars.Value [0], c1 [0], "#1 Should be same");
		}
开发者ID:LevNNN,项目名称:mono,代码行数:9,代码来源:SqlCharsTest.cs


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