public void EncodedSpan_is_empty___0() { var sut = new Base64Encoder(); var emptySpan = Array.Empty <T>().AsSpan(); int actual = sut.GetDecodedLengthImpl <T>(emptySpan); Assert.AreEqual(0, actual); }
public void EncodedSpan_is_empty___0() { var sut = new Base64Encoder(); var emptySpan = ReadOnlySpan <T> .Empty; int actual = sut.GetDecodedLengthImpl <T>(emptySpan); Assert.AreEqual(0, actual); }
public void Issue_32_EncodedLength_is_lt_4___throws_ArgumentOutOfRange(int encodedLength) { T a = Unsafe.As <char, T>(ref Unsafe.AsRef('=')); T[] encoded = Enumerable.Repeat(a, encodedLength).ToArray(); var sut = new Base64Encoder(); Exception exception = Assert.Catch(() => sut.GetDecodedLengthImpl <T>(encoded)); Assert.Multiple(() => { Assert.IsInstanceOf <ArgumentOutOfRangeException>(exception); string msg = $"The 'encodedLength' is outside the allowed range by the base64 standard. It must be >= 4."; StringAssert.StartsWith(msg, exception.Message); }); }