예제 #1
0
파일: Any.cs 프로젝트: divyang4481/IIOPNet
        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");
        }
예제 #2
0
파일: Any.cs 프로젝트: divyang4481/IIOPNet
        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");
        }
예제 #3
0
파일: Any.cs 프로젝트: divyang4481/IIOPNet
        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");
        }