本文整理汇总了C#中System.Data.SqlTypes.SqlByte类的典型用法代码示例。如果您正苦于以下问题:C# SqlByte类的具体用法?C# SqlByte怎么用?C# SqlByte使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SqlByte类属于System.Data.SqlTypes命名空间,在下文中一共展示了SqlByte类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateIPv4
public static IPv4 CreateIPv4(SqlByte i1, SqlByte i2, SqlByte i3, SqlByte i4)
{
IPv4 ip = new IPv4(i1.Value, i2.Value, i3.Value, i4.Value);
if (ip == null)
return IPv4.Null;
else
return ip;
}
开发者ID:odelljl,项目名称:sqlproj,代码行数:8,代码来源:IPv4Function.cs
示例2: Properties
public void Properties()
{
SqlByte TestByte = new SqlByte(54);
SqlByte TestByte2 = new SqlByte(1);
Assert.True(SqlByte.Null.IsNull);
Assert.Equal((byte)54, TestByte.Value);
Assert.Equal((byte)1, TestByte2.Value);
}
开发者ID:dotnet,项目名称:corefx,代码行数:9,代码来源:SqlByteTest.cs
示例3: Properties
public void Properties()
{
SqlByte TestByte = new SqlByte(54);
SqlByte TestByte2 = new SqlByte(1);
Assert.IsTrue (SqlByte.Null.IsNull, "IsNull property" + Error);
Assert.AreEqual((byte)54, TestByte.Value, "Value property 1" + Error);
Assert.AreEqual((byte)1, TestByte2.Value, "Value property 2" + Error);
}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:SqlByteTest.cs
示例4: Properties
public void Properties()
{
SqlByte TestByte = new SqlByte(54);
SqlByte TestByte2 = new SqlByte(1);
Assert("IsNull property" + Error, SqlByte.Null.IsNull);
AssertEquals("Value property 1" + Error, (byte)54, TestByte.Value);
AssertEquals("Value property 2" + Error, (byte)1, TestByte2.Value);
}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:11,代码来源:SqlByteTest.cs
示例5: Account_AccountBalances_GetRelativeBalance
public static SqlMoney Account_AccountBalances_GetRelativeBalance(SqlByte b1)
{
switch ((int) b1)
{
case 1:
case 2:
case 3:
case 4:
case 5:
break;
}
// Put your code here
return new SqlMoney(0m);
}
开发者ID:weavver,项目名称:data,代码行数:18,代码来源:Accounting_AccountBalances.cs
示例6: AddMethod
public void AddMethod()
{
SqlByte TestByte64 = new SqlByte(64);
SqlByte TestByte0 = new SqlByte(0);
SqlByte TestByte164 = new SqlByte(164);
SqlByte TestByte255 = new SqlByte(255);
Assert.Equal((byte)64, SqlByte.Add(TestByte64, TestByte0).Value);
Assert.Equal((byte)228, SqlByte.Add(TestByte64, TestByte164).Value);
Assert.Equal((byte)164, SqlByte.Add(TestByte0, TestByte164).Value);
Assert.Equal((byte)255, SqlByte.Add(TestByte255, TestByte0).Value);
try
{
SqlByte.Add(TestByte255, TestByte64);
Assert.False(true);
}
catch (Exception e)
{
Assert.Equal(typeof(OverflowException), e.GetType());
}
}
开发者ID:dotnet,项目名称:corefx,代码行数:22,代码来源:SqlByteTest.cs
示例7: DivisionOperator
public void DivisionOperator()
{
SqlByte TestByte2 = new SqlByte(2);
SqlByte TestByte4 = new SqlByte(4);
SqlByte TestByte255 = new SqlByte(255);
SqlByte TestByte0 = new SqlByte(0);
Assert.AreEqual((SqlByte)2,TestByte4 / TestByte2, "Division operator 1" + Error);
Assert.AreEqual((SqlByte)127, TestByte255 / TestByte2, "Division operaror 2" + Error);
try {
TestByte2 = TestByte255 / TestByte0;
Assert.Fail("Division operator 3" + Error);
} catch (Exception e) {
Assert.AreEqual(typeof(DivideByZeroException), e.GetType(), "DivideByZeroException");
}
}
开发者ID:Profit0004,项目名称:mono,代码行数:19,代码来源:SqlByteTest.cs
示例8: BitwiseOrOperator
public void BitwiseOrOperator()
{
SqlByte TestByte2 = new SqlByte(2);
SqlByte TestByte4 = new SqlByte(4);
SqlByte TestByte255 = new SqlByte(255);
Assert.AreEqual((SqlByte)6,TestByte2 | TestByte4, "Bitwise or operator 1" + Error);
Assert.AreEqual((SqlByte)255, TestByte2 | TestByte255, "Bitwise or operaror 2" + Error);
}
开发者ID:Profit0004,项目名称:mono,代码行数:10,代码来源:SqlByteTest.cs
示例9: BitwiseAndOperator
public void BitwiseAndOperator()
{
SqlByte TestByte2 = new SqlByte(2);
SqlByte TestByte4 = new SqlByte(4);
SqlByte TestByte255 = new SqlByte(255);
Assert.AreEqual((SqlByte)0,TestByte2 & TestByte4, "Bitwise and operator 1" + Error);
Assert.AreEqual((SqlByte)2, TestByte2 & TestByte255, "Bitwise and operaror 2" + Error);
}
开发者ID:Profit0004,项目名称:mono,代码行数:10,代码来源:SqlByteTest.cs
示例10: Subtract
public void Subtract()
{
SqlByte TestByte12 = new SqlByte(12);
SqlByte TestByte128 = new SqlByte(128);
Assert.AreEqual((byte)116, SqlByte.Subtract(TestByte128, TestByte12).Value, "Subtract method 1" + Error);
try {
SqlByte.Subtract(TestByte12, TestByte128);
} catch(Exception e) {
Assert.AreEqual(typeof(OverflowException), e.GetType(), "OverflowException");
}
}
开发者ID:Profit0004,项目名称:mono,代码行数:15,代码来源:SqlByteTest.cs
示例11: SqlByteToByte
public void SqlByteToByte()
{
SqlByte TestByte = new SqlByte(12);
byte test = (byte)TestByte;
Assert.AreEqual((byte)12, test, "SqlByteToByte" + Error);
}
开发者ID:Profit0004,项目名称:mono,代码行数:6,代码来源:SqlByteTest.cs
示例12: OnesComplementOperator
public void OnesComplementOperator()
{
SqlByte TestByte12 = new SqlByte(12);
SqlByte TestByte128 = new SqlByte(128);
Assert.AreEqual((SqlByte)243, ~TestByte12, "OnesComplement operator 1" + Error);
Assert.AreEqual((SqlByte)127, ~TestByte128, "OnesComplement operator 2" + Error);
}
开发者ID:Profit0004,项目名称:mono,代码行数:10,代码来源:SqlByteTest.cs
示例13: ThanOrEqualOperators
public void ThanOrEqualOperators()
{
SqlByte TestByte165 = new SqlByte(165);
SqlByte TestByte100 = new SqlByte(100);
SqlByte TestByte100II = new SqlByte(100);
SqlByte TestByte255 = new SqlByte(255);
Assert.IsTrue ((TestByte165 > TestByte100).Value, "> operator 1" + Error);
Assert.IsTrue (!(TestByte165 > TestByte255).Value, "> operator 2" + Error);
Assert.IsTrue (!(TestByte100 > TestByte100II).Value, "> operator 3" + Error);
Assert.IsTrue (!(TestByte165 >= TestByte255).Value, ">= operator 1" + Error);
Assert.IsTrue ((TestByte255 >= TestByte165).Value, ">= operator 2" + Error);
Assert.IsTrue ((TestByte100 >= TestByte100II).Value, ">= operator 3" + Error);
Assert.IsTrue (!(TestByte165 < TestByte100).Value, "< operator 1" + Error);
Assert.IsTrue ((TestByte165 < TestByte255).Value, "< operator 2" + Error);
Assert.IsTrue (!(TestByte100 < TestByte100II).Value, "< operator 3" + Error);
Assert.IsTrue ((TestByte165 <= TestByte255).Value, "<= operator 1" + Error);
Assert.IsTrue (!(TestByte255 <= TestByte165).Value, "<= operator 2" + Error);
Assert.IsTrue ((TestByte100 <= TestByte100II).Value, "<= operator 3" + Error);
}
开发者ID:Profit0004,项目名称:mono,代码行数:22,代码来源:SqlByteTest.cs
示例14: ToSqlSingle
public void ToSqlSingle()
{
SqlByte TestByte12 = new SqlByte(12);
SqlByte TestByte0 = new SqlByte(0);
SqlByte TestByte228 = new SqlByte(228);
Assert.AreEqual((float)12, TestByte12.ToSqlSingle().Value, "ToSqlSingle method 1" + Error);
Assert.AreEqual((float)0, TestByte0.ToSqlSingle().Value, "ToSqlSingle method 2" + Error);
Assert.AreEqual((float)228, TestByte228.ToSqlSingle().Value, "ToSqlSingle method 3" + Error);
}
开发者ID:Profit0004,项目名称:mono,代码行数:12,代码来源:SqlByteTest.cs
示例15: ToSqlMoney
public void ToSqlMoney()
{
SqlByte TestByte12 = new SqlByte(12);
SqlByte TestByte0 = new SqlByte(0);
SqlByte TestByte228 = new SqlByte(228);
Assert.AreEqual(12.0000M, TestByte12.ToSqlMoney().Value, "ToSqMoney method 1" + Error);
Assert.AreEqual((decimal)0, TestByte0.ToSqlMoney().Value, "ToSqlMoney method 2" + Error);
Assert.AreEqual(228.0000M, TestByte228.ToSqlMoney().Value, "ToSqlMoney method 3" + Error);
}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:SqlByteTest.cs
示例16: ToSqlInt64
public void ToSqlInt64()
{
SqlByte TestByte12 = new SqlByte(12);
SqlByte TestByte0 = new SqlByte(0);
SqlByte TestByte228 = new SqlByte(228);
Assert.AreEqual((long)12, TestByte12.ToSqlInt64().Value, "ToSqInt64 method " + Error);
Assert.AreEqual((long)0, TestByte0.ToSqlInt64().Value, "ToSqlInt64 method 2" + Error);
Assert.AreEqual((long)228, TestByte228.ToSqlInt64().Value, "ToSqlInt64 method 3" + Error);
}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:SqlByteTest.cs
示例17: ToSqlInt32
public void ToSqlInt32()
{
SqlByte TestByte12 = new SqlByte(12);
SqlByte TestByte0 = new SqlByte(0);
SqlByte TestByte228 = new SqlByte(228);
Assert.AreEqual((int)12, TestByte12.ToSqlInt32().Value, "ToSqInt32 method 1" + Error);
Assert.AreEqual((int)0, TestByte0.ToSqlInt32().Value, "ToSqlInt32 method 2" + Error);
Assert.AreEqual((int)228, TestByte228.ToSqlInt32().Value, "ToSqlInt32 method 3" + Error);
}
开发者ID:Profit0004,项目名称:mono,代码行数:12,代码来源:SqlByteTest.cs
示例18: ToSqlDecimal
public void ToSqlDecimal()
{
SqlByte TestByte12 = new SqlByte(12);
SqlByte TestByte0 = new SqlByte(0);
SqlByte TestByte228 = new SqlByte(228);
Assert.AreEqual((decimal)12, TestByte12.ToSqlDecimal().Value, "ToSqlDecimal method 1" + Error);
Assert.AreEqual((decimal)0, TestByte0.ToSqlDecimal().Value, "ToSqlDecimal method 2" + Error);
Assert.AreEqual((decimal)228, TestByte228.ToSqlDecimal().Value, "ToSqlDecimal method 3" + Error);
}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:SqlByteTest.cs
示例19: ToSqlBoolean
public void ToSqlBoolean()
{
SqlByte TestByte12 = new SqlByte(12);
SqlByte TestByte0 = new SqlByte(0);
SqlByte TestByteNull = SqlByte.Null;
Assert.IsTrue (TestByte12.ToSqlBoolean().Value, "ToSqlBoolean method 1" + Error);
Assert.IsTrue (!TestByte0.ToSqlBoolean().Value, "ToSqlBoolean method 2" + Error);
Assert.IsTrue (TestByteNull.ToSqlBoolean().IsNull, "ToSqlBoolean method 3" + Error);
}
开发者ID:Profit0004,项目名称:mono,代码行数:11,代码来源:SqlByteTest.cs
示例20: EqualityOperator
public void EqualityOperator()
{
SqlByte TestByte15 = new SqlByte(15);
SqlByte TestByte15II = new SqlByte(15);
SqlByte TestByte255 = new SqlByte(255);
Assert.IsTrue ((TestByte15 == TestByte15II).Value, "== operator" + Error);
Assert.IsTrue (!(TestByte15 == TestByte255).Value, "== operator 2" + Error);
Assert.IsTrue (!(TestByte15 != TestByte15II).Value, "!= operator" + Error);
Assert.IsTrue ((TestByte15 != TestByte255).Value, "!= operator 2" + Error);
}
开发者ID:Profit0004,项目名称:mono,代码行数:13,代码来源:SqlByteTest.cs
注:本文中的System.Data.SqlTypes.SqlByte类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论