コード例 #1
0
ファイル: Any.cs プロジェクト: JnS-Software-LLC/iiop-net
 public void BoxSByteToOctet()
 {
     sbyte val = 11;
     omg.org.CORBA.TypeCode tc = new OctetTC();
     Any anyContainer = new Any(val, tc);
     Assert.AreEqual(tc, anyContainer.Type, "wrong tc");
     Assert.AreEqual((byte)val, anyContainer.Value, "wrong val");
     Assert.AreEqual((byte)val, anyContainer.ClsValue, "wrong val");
     Assert.AreEqual(ReflectionHelper.ByteType,
                            anyContainer.ClsValue.GetType(), "wrong val type");
 }
コード例 #2
0
ファイル: Any.cs プロジェクト: JnS-Software-LLC/iiop-net
 public void BoxSByteToOctetOutsideRange()
 {
     sbyte val = -11;
     omg.org.CORBA.TypeCode tc = new OctetTC();
     Any anyContainer = new Any(val, tc);
     Assert.AreEqual(tc, anyContainer.Type, "wrong tc");
     // do an unchecked cast, overflow no issue here
     Assert.AreEqual(unchecked((byte)val), anyContainer.Value, "wrong val");
     Assert.AreEqual(unchecked((byte)val), anyContainer.ClsValue, "wrong val");
     Assert.AreEqual(ReflectionHelper.ByteType,
                            anyContainer.ClsValue.GetType(), "wrong val type");
 }
コード例 #3
0
ファイル: Any.cs プロジェクト: JnS-Software-LLC/iiop-net
 public void BoxOctet()
 {
     byte val = 11;
     omg.org.CORBA.TypeCode tc = new OctetTC();
     Any anyContainer = new Any(val, tc);
     Assert.AreEqual(tc, anyContainer.Type, "wrong tc");
     Assert.AreEqual(val, anyContainer.Value, "wrong val");
     Assert.AreEqual(val, anyContainer.ClsValue, "wrong val");
 }