public void TestDouble() { double input = 1; ByteToStringConverter converter = new ByteToStringConverter(); string result = (string)converter.Convert(input, typeof(double), null, null); Assert.AreEqual("1 KB", result); }
public void TestLargeInt() { int input = 100000000; ByteToStringConverter converter = new ByteToStringConverter(); string result = (string)converter.Convert(input, typeof(double), null, null); Assert.AreEqual("95.37 MB", result); }
public void ConvertShouldConvertBytesToHexRepresentation() { var btsc = new ByteToStringConverter(); var input = new byte[] { 0x11, 0x22, 0x33, 0xFF }; var expectedOutput = "112233ff"; var convertedBytes = btsc.Convert(input); Assert.AreEqual(expectedOutput, convertedBytes); }
public void ConvertEmptyInputShouldReturnEmptyString() { var btsc = new ByteToStringConverter(); var input = new byte[] {}; var expectedOutput = string.Empty; var convertedBytes = btsc.Convert(input); Assert.AreEqual(expectedOutput, convertedBytes); }
public void OneTimeSetUp() { _converter = new ByteToStringConverter(); }
public Sha1HashImplementation() { _sha1 = SHA1.Create(); _btsc = new ByteToStringConverter(); }