public void DecodeByteString_NotEnoughBytesInInput_Exception() { var input = "100:12345"; var inputStream = new MemoryStream(Encoding.ASCII.GetBytes(input), false); var transform = new ByteStringTransform(); var bstrObj = transform.Decode(inputStream); }
public void DecodeByteString_InsaneByteStringLength_Exception() { var input = "12345678901234567890:123"; var inputStream = new MemoryStream(Encoding.ASCII.GetBytes(input), false); var transform = new ByteStringTransform(); var bstrObj = transform.Decode(inputStream); }
public void DecodeByteString_NoBytesInInput_Positive() { var inputStream = new MemoryStream(new byte[] { 48, 58 }, false); // "0:" var transform = new ByteStringTransform(); var bstrObj = transform.Decode(inputStream); Assert.AreEqual<long>(0L, bstrObj.Value.Length); }
public void DecodeByteString_SimpleScenario_Positive() { var inputStream = new MemoryStream(new byte[] { 52, 58, 49, 50, 51, 52 }, false); // "4:1234" var expectedOutput = new byte[] { 49, 50, 51, 52 }; var transform = new ByteStringTransform(); var bstrObj = transform.Decode(inputStream); Assert.IsTrue(expectedOutput.IsEqualWith(bstrObj.Value), "Outputted bytes are different than expected"); }
public void DecodeByteString_NullInputStream_Exception() { var transform = new ByteStringTransform(); var bstrObj = transform.Decode(null); }