Exemplo n.º 1
0
        public void VOID_ToNativeValue()
        {
            AMQType type = AMQType.VOID;

            Assert.IsNull(type.ToNativeValue(null));

            try
            {
                type.ToNativeValue("asdasd");
                Assert.Fail("converted invalid value");
            } catch (FormatException)
            {
            }
        }
Exemplo n.º 2
0
        public void BOOLEAN_ToNativeValue()
        {
            AMQType type = AMQType.BOOLEAN;

            Assert.AreEqual(true, type.ToNativeValue(true));
            Assert.AreEqual(false, type.ToNativeValue("false"));

            try
            {
                type.ToNativeValue("asdasd");
                Assert.Fail("converted invalid value");
            } catch (FormatException)
            {
            }
        }
Exemplo n.º 3
0
        public void UINT32_ToNativeValue()
        {
            AMQType type = AMQType.UINT32;

            Assert.AreEqual(1, type.ToNativeValue(1));
            Assert.AreEqual(1, type.ToNativeValue((short)1));
            Assert.AreEqual(1, type.ToNativeValue((byte)1));
            Assert.AreEqual(1, type.ToNativeValue("1"));

            try
            {
                Assert.AreEqual(1, type.ToNativeValue("adasdads"));
                Assert.Fail("Invalid format allowed");
            } catch (FormatException)
            {
            }
        }