public void LongConverterFromDecimal() { var converter = new LongConverter(); var result = converter.Convert(77.5); Assert.AreEqual(78L, result); }
public void LongConverter(object input, long?expected) { var converter = new LongConverter(); var result = converter.Convert(input); Assert.AreEqual(expected, result); }
public void Convert_ThrowsException_WhenNotInteger() { var py = Python.Instance(); var pyStr = py.Eval("\"omershelef\""); var converter = new LongConverter(); Assert.Throws<ConversionException>(() => converter.Convert(pyStr)); }
public void Convert_ReturnLong_WhenLong() { var py = Python.Instance(); var pyLong = py.Eval("12345678910"); var converter = new LongConverter(); Assert.AreEqual(12345678910L, converter.Convert(pyLong)); }
public void Convert_ReturnLong_WhenInt() { var py = Python.Instance(); var pyInt = py.Eval("55"); var converter = new LongConverter(); NUnit.Framework.Assert.AreEqual(55, converter.Convert(pyInt)); }
public void LongConverter_CorrectConversionTest() { Array[] data = new long[][] { new long[] { long.MinValue, long.MaxValue }, new long[] { -30000, 60000 }, }; var converter = new LongConverter(); var sut = converter.Convert(data, 2, 2); var expectation = new ushort[] { 0, ushort.MaxValue, 32767, 32767 }; sut.Should().BeEquivalentTo(expectation); }