public void TestInt16BackCoverterForIllegal(string inputValue, string format) { var varInfo = new Int16VariableInfo(); varInfo.FormatSelectedItem = format; var wVal = varInfo.Value; Assert.ThrowsException <OverflowException>(() => wVal.ConvertBack(inputValue)); }
public void TestInt16BackCoverter(string inputValue, string format, Int16 expectedDisplayValue) { var varInfo = new Int16VariableInfo(); varInfo.FormatSelectedItem = format; var wVal = varInfo.Value; var convVal = (WrappedValue <Int16>)wVal.ConvertBack(inputValue); Assert.AreEqual(convVal.Value, expectedDisplayValue); }
public void TestInt16Coverter(Int16 inputValue, string format, string expectedDisplayValue) { var varInfo = new Int16VariableInfo(); varInfo.FormatSelectedItem = format; var wVal = varInfo.Value; wVal.Value = inputValue; var convVal = wVal.Convert(); Assert.AreEqual(convVal, expectedDisplayValue); }