public void TestSByteBackCoverterForIllegal(string inputValue, string format) { var varInfo = new SByteVariableInfo(); varInfo.FormatSelectedItem = format; var wVal = varInfo.Value; Assert.ThrowsException <OverflowException>(() => wVal.ConvertBack(inputValue)); }
public void TestSByteBackCoverter(string inputValue, string format, sbyte expectedDisplayValue) { var varInfo = new SByteVariableInfo(); varInfo.FormatSelectedItem = format; var wVal = varInfo.Value; var convVal = (WrappedValue <sbyte>)wVal.ConvertBack(inputValue); Assert.AreEqual(convVal.Value, expectedDisplayValue); }
public void TestSByteeanVariableInfo() { var vi = new SByteVariableInfo(); Assert.AreEqual(vi.Value.Value, 0); vi.WriteValue = new WrappedValue <sbyte>(-128, FormatType.DEC, null, null); Assert.AreEqual(vi.WriteValue.Value, -128); Assert.AreEqual(vi.Value.Value, -128); }
public void TestSByteCoverter(sbyte inputValue, string format, string expectedDisplayValue) { var varInfo = new SByteVariableInfo(); varInfo.FormatSelectedItem = format; var wVal = varInfo.Value; wVal.Value = inputValue; var convVal = wVal.Convert(); Assert.AreEqual(convVal, expectedDisplayValue); }