public void EmptyNeedle()
        {
            // Arrange
            var haystackByteArray = Encoding.ASCII.GetBytes("This haystack does not contain a n-e-e-d-l-e");
            var emptyNeedle       = string.Empty;

            using (var memStream = new MemoryStream(haystackByteArray))
                using (var sStream = new SearchableStringStream(memStream))
                {
                    // Act
                    var foundPosition = sStream.LastIndexOf(emptyNeedle);
                }
        }
        public void SingleOccuranceAtEnd()
        {
            // Arrange
            var haystackByteArray = Encoding.ASCII.GetBytes("haystack with a needle");
            var needle            = "needle";

            using (var memStream = new MemoryStream(haystackByteArray))
                using (var sStream = new SearchableStringStream(memStream))
                {
                    // Act
                    var foundPosition = sStream.LastIndexOf(needle);

                    // Assert
                    Assert.AreEqual(16, foundPosition);
                }
        }
        public void NotInStream()
        {
            // Arrange
            var haystackByteArray = Encoding.ASCII.GetBytes("This haystack does not contain a n-e-e-d-l-e");
            var needle            = "needle";

            using (var memStream = new MemoryStream(haystackByteArray))
                using (var sStream = new SearchableStringStream(memStream))
                {
                    // Act
                    var foundPosition = sStream.LastIndexOf(needle);

                    // Assert
                    Assert.AreEqual(-1, foundPosition);
                }
        }
        public void EmptyStream()
        {
            // Arrange
            var emptyByteArray = new byte[0];
            var needle         = "needle";

            using (var memStream = new MemoryStream(emptyByteArray))
                using (var sStream = new SearchableStringStream(memStream))
                {
                    // Act
                    var foundPosition = sStream.LastIndexOf(needle);

                    // Assert
                    Assert.AreEqual(-1, foundPosition);
                }
        }
        public void MultipleOccurance()
        {
            // Arrange
            var haystackByteArray = Encoding.ASCII.GetBytes("This hay stack has a needle here and another needle here and another needle here");
            var needle            = "needle";

            using (var memStream = new MemoryStream(haystackByteArray))
                using (var sStream = new SearchableStringStream(memStream))
                {
                    // Act
                    var foundPosition = sStream.LastIndexOf(needle);

                    // Assert
                    Assert.AreEqual(69, foundPosition);
                }
        }