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"); }
public void Setup() { m_tc = new UShortTC(); }
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"); }
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"); }
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"); }