Exemplo n.º 1
0
        public void TestToString()
        {
            byte[]      value = Encoding.UTF7.GetBytes("Test ToString method.");
            BinaryField field = new BinaryField(12);

            Assert.IsTrue(string.Empty.Equals(field.ToString()));
            field.Value = value;

            Assert.IsTrue(Encoding.UTF7.GetString(value).Equals(field.ToString()));
        }
Exemplo n.º 2
0
        public void TestClone()
        {
            byte[]      value = Encoding.UTF7.GetBytes("Test Clone method.");
            BinaryField field = new BinaryField(14);

            BinaryField clonedField = ( BinaryField)(field.Clone());

            Assert.IsNull(clonedField.Value);
            Assert.IsTrue(field.FieldNumber == clonedField.FieldNumber);

            field.Value = value;
            clonedField = ( BinaryField)(field.Clone());

            Assert.IsTrue(field.ToString().Equals(clonedField.ToString()));
            Assert.IsTrue(field.Value != clonedField.Value);
        }