public void GivenASingleIllegalValueShouldThrowArgumentOutOfRangeException() { var input = new[] { (byte)42 }; // Call ToArray() to force evaluation of the enumerable, // as the underlying implementation is lazy. Assert.Throws<ArgumentOutOfRangeException>(() => input.EncodeQuintets().ToArray()); }
public void GivenASingleLegalValueShouldReturnASingleEncodedValue() { var values = Constants.EncodingAlphabet.ToArray(); for (byte i = 0; i < values.Length; i++) { var input = new[] { i }; var expected = new[] { values[i] }; var actual = input.EncodeQuintets(); CollectionAssert.AreEqual(expected, actual); } }