public void TestByteBackCoverterForIllegal(string inputValue, string format) { var varInfo = new ByteDataValue(new DataValue(new Variant((byte)0))); varInfo.FormatSelectedItem = format; Assert.ThrowsException <OverflowException>(() => varInfo.ConvertValueBack(inputValue)); }
public void TestByteBackCoverter(string inputValue, string format, byte expectedDisplayValue) { var varInfo = new ByteDataValue(new DataValue(new Variant((byte)0))); varInfo.FormatSelectedItem = format; varInfo.ConvertValueBack(inputValue); Assert.AreEqual(varInfo.GetRawValue(), expectedDisplayValue); }