Ejemplo n.º 1
0
 public void TestEquivalent()
 {
     UShortTC other = new UShortTC();
     Assert.IsTrue(m_tc.equivalent(other), "not equal");
     ShortTC other2 = new ShortTC();
     Assert.IsTrue(!m_tc.equivalent(other2), "equal but shoudln't");
 }
Ejemplo n.º 2
0
 public void Setup()
 {
     m_tc = new UShortTC();
 }
Ejemplo n.º 3
0
 public void BoxUShortFromCls()
 {
     short val = 11;
     omg.org.CORBA.TypeCode tc = new UShortTC();
     Any anyContainer = new Any(val, tc);
     Assert.AreEqual(tc, anyContainer.Type, "wrong tc");
     Assert.AreEqual((ushort)val, anyContainer.Value, "wrong val");
     Assert.AreEqual(((ushort)val).GetType(), anyContainer.Value.GetType(), "wrong val");
     Assert.AreEqual(val, anyContainer.ClsValue, "wrong val");
 }
Ejemplo n.º 4
0
 public void BoxUShortFromClsOutsideRange()
 {
     short val = -11;
     omg.org.CORBA.TypeCode tc = new UShortTC();
     Any anyContainer = new Any(val, tc);
     Assert.AreEqual(tc, anyContainer.Type, "wrong tc");
     // do an unchecked cast, overflow no issue here
     Assert.AreEqual(unchecked((ushort)val), anyContainer.Value, "wrong val");
     Assert.AreEqual(unchecked((ushort)val).GetType(), anyContainer.Value.GetType(), "wrong val");
     Assert.AreEqual(val, anyContainer.ClsValue, "wrong val");
 }
Ejemplo n.º 5
0
 public void BoxUShort()
 {
     ushort val = 11;
     omg.org.CORBA.TypeCode tc = new UShortTC();
     Any anyContainer = new Any(val, tc);
     Assert.AreEqual(tc, anyContainer.Type, "wrong tc");
     Assert.AreEqual(val, anyContainer.Value, "wrong val");
     Assert.AreEqual((short)val, anyContainer.ClsValue, "wrong val");
     Assert.AreEqual(ReflectionHelper.Int16Type,
                            anyContainer.ClsValue.GetType(), "wrong val type");
 }