コード例 #1
0
        public void GivenASingleIllegalValueShouldThrowArgumentOutOfRangeException()
        {
            var input = new[] { '!' };

            // Call ToArray() to force evaluation of the enumerable,
            // as the underlying implementation is lazy.
            Assert.Throws<ArgumentOutOfRangeException>(() => input.DecodeToQuintets().ToArray());
        }
コード例 #2
0
 public void GivenASingleLegalValueShouldReturnASingleDecodedValue()
 {
     var values = Constants.EncodingAlphabet.ToArray();
     for (byte i = 0; i < values.Length; i++)
     {
         var input = new[] { values[i] };
         var expected = new[] { i };
         var actual = input.DecodeToQuintets();
         CollectionAssert.AreEqual(expected, actual);
     }
 }
コード例 #3
0
 public void GivenANumberOfLegalValuesAndAtLeastOneIllegalValueShouldThrowArgumentOutOfRangeException()
 {
     var input = new[] { '2', 'o', 'z', '!', 'o' };
     var actual = input.DecodeToQuintets();
     Assert.Throws<ArgumentOutOfRangeException>(() => actual.ToArray());
 }