本文整理汇总了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");
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}
示例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");
}
示例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));
}
示例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");
});
}
示例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));
}
示例10: Write_NullBufferAndInstanceValueTest
public void Write_NullBufferAndInstanceValueTest()
{
char[] c1 = null;
SqlChars chars = new SqlChars();
Assert.Throws<ArgumentNullException>(() => chars.Write(0, c1, 0, 10));
}
示例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));
}
示例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));
}
示例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));
}
示例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");
}
示例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");
}