Пример #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");
 }
Пример #2
0
 public void Setup()
 {
     m_tc = new UShortTC();
 }
Пример #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");
 }
Пример #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");
 }
Пример #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");
 }