public void Ctor_Trim_Set_Test(bool trim)
        {
            // Arrange
            var enumerable = new LittleEndianByteEnumerable(Array.Empty <byte>(), trim);

            // Act
            // Assert
            Assert.Equal(trim, enumerable.IsTrimmed);
        }
        public void Ctor_Trim_Default_Test()
        {
            // Arrange
            var enumerable = new LittleEndianByteEnumerable(Array.Empty <byte>());

            // Act
            // Assert
            Assert.True(enumerable.IsTrimmed);
        }
        public void IsLittleEndian_Test()
        {
            // Arrange
            var enumerable = new LittleEndianByteEnumerable(Array.Empty <byte>());

            // Act
            // Assert
            Assert.True(enumerable.IsLittleEndian);
        }
        public void Iteration_Untrimmed_Test()
        {
            // Arrange
            var input    = new byte[] { 0x00, 0xAC, 0xCA, 0x00, 0x00 };
            var expected = input;

            var enumerable = new LittleEndianByteEnumerable(input, false);

            // Act
            // Assert
            Assert.Equal(expected, enumerable);
        }
        public void Iteration_Trimmed_Test()
        {
            // Arrange
            var input    = new byte[] { 0x00, 0xAC, 0xCA, 0x00, 0x00 };
            var expected = input.Reverse()
                           .SkipWhile(b => b == 0x00)
                           .Reverse();

            var enumerable = new LittleEndianByteEnumerable(input);

            // Act
            // Assert
            Assert.Equal(expected, enumerable);
        }
        public void ReverseEnumeration_Untrimmed_Test()
        {
            // Arrange
            var input    = new byte[] { 0x00, 0xAC, 0xCA, 0x00, 0x00 };
            var expected = input.Reverse();

            var enumerable = new LittleEndianByteEnumerable(input, false);

            // Act
            var result = enumerable.ReverseEnumerable();

            // Assert
            Assert.NotNull(result);
            Assert.IsAssignableFrom <IEnumerable <byte> >(result);
            Assert.Equal(expected, result);
        }
        public void Enumerate_Untrimmed_Test()
        {
            // Arrange
            var input    = new byte[] { 0x00, 0xAC, 0xCA, 0x00, 0x00 };
            var expected = input;

            var enumerable = new LittleEndianByteEnumerable(input, false);

            // Act
            var result = new List <byte>();

            foreach (var b in enumerable)
            {
                result.Add(b);
            }

            // Assert
            Assert.Equal(expected, result);
        }
        public void Enumerate_Trimmed_Test()
        {
            // Arrange
            var input    = new byte[] { 0x00, 0xAC, 0xCA, 0x00, 0x00 };
            var expected = input.Reverse()
                           .SkipWhile(b => b == 0x00)
                           .Reverse();

            var enumerable = new LittleEndianByteEnumerable(input);

            // Act
            var result = new List <byte>();

            foreach (var b in enumerable)
            {
                result.Add(b);
            }

            // Assert
            Assert.Equal(expected, result);
        }