public void TestReplaceReal05()
        {
            #region Arrange

            string writtenString;
            string path = @"C:\Users\kreich\Desktop\new  3.txt";
            List<Replacement> replacements;
            using (Stream input = File.OpenRead(path))
            {

                MemoryStream outputStream = new MemoryStream();

                replacements = new List<Replacement>
                                   {
                                       new Replacement {OldValue = "aaa", NewValue = "b"},
                                       new Replacement {OldValue = "kda", NewValue = "zz"}
                                   };
                //replacements = new List<Replacement> {new Replacement {OldValue = "aaa", NewValue = "aab"}};
                var streamWriter = new StreamWriter(outputStream);
                var sut = new ReplaceStreamContentCore(new StreamReader(input), streamWriter, 1000, replacements);

                #endregion

                #region Act

                Stopwatch sw = new Stopwatch();
                sw.Start();
                sut.Replace();
                sw.Stop();

                Console.WriteLine(sw.ElapsedMilliseconds);

                streamWriter.Flush();

                #endregion

                outputStream.Position = 0;

                writtenString = Encoding.ASCII.GetString(outputStream.ToArray());
            }

            #region Assert

            var inputString = File.ReadAllText(path);
            foreach (var replacement in replacements)
            {
                inputString = inputString.Replace(replacement.OldValue, replacement.NewValue);
            }

            writtenString.Should().Be(inputString);

            #endregion
        }
        public void TestReplaceReal02a(string stringToReplace)
        {
            #region Arrange

            string inputString = @"kda0123456789kda0123456789";
            Stream input = GenerateStreamFromString(inputString);
            MemoryStream outputStream = new MemoryStream();

            List<Replacement> replacements = new List<Replacement>
                                   {
                                       new Replacement {OldValue = stringToReplace, NewValue = "b"},
                                       new Replacement {OldValue = "kda", NewValue = "zz"}
                                   };
            var streamWriter = new StreamWriter(outputStream);
            var sut = new ReplaceStreamContentCore(new StreamReader(input), streamWriter, 5, replacements);

            #endregion

            #region Act
            sut.Replace();
            streamWriter.Flush();
            #endregion

            #region Assert

            outputStream.Position = 0;

            foreach (var replacement in replacements)
            {
                inputString = inputString.Replace(replacement.OldValue, replacement.NewValue);
            }

            string writtenString = Encoding.ASCII.GetString(outputStream.ToArray());
            writtenString.Should().Be(inputString);

            #endregion
        }
        public void TestReplaceReal04()
        {
            #region Arrange

            string inputString = "11aabzzaaasdlkjfdghjkdasadlkjasdhjkgfdsalakjsdasdhjksdfsaldfkasdhjaaasdsdfjk";
            Stream input = GenerateStreamFromString(inputString);
            MemoryStream outputStream = new MemoryStream();

            List<Replacement> replacements = new List<Replacement> { new Replacement { OldValue = "aaa", NewValue = "aab" } };
            var streamWriter = new StreamWriter(outputStream);
            var sut = new ReplaceStreamContentCore(new StreamReader(input), streamWriter, 8, replacements);

            #endregion

            #region Act
            sut.Replace();
            streamWriter.Flush();
            #endregion

            #region Assert

            outputStream.Position = 0;

            string writtenString = Encoding.ASCII.GetString(outputStream.ToArray());
            writtenString.Should().Be(inputString.Replace("aaa", "aab"));

            #endregion
        }
        public void TestReplaceReal01()
        {
            #region Arrange

            string inputString = "11aabzza";
            Stream input = GenerateStreamFromString(inputString);
            MemoryStream outputStream = new MemoryStream();

            List<Replacement> replacements = new List<Replacement> { new Replacement { OldValue = "22", NewValue = "11" }, new Replacement { OldValue = "aaa", NewValue = "aab" } };
            var streamWriter = new StreamWriter(outputStream);
            var sut = new ReplaceStreamContentCore(new StreamReader(input), streamWriter, 8, replacements);

            #endregion

            #region Act
            sut.Replace();
            streamWriter.Flush();
            #endregion

            #region Assert

            outputStream.Position = 0;

            string writtenString = Encoding.ASCII.GetString(outputStream.ToArray());
            writtenString.Should().Be("11aabzza");

            #endregion
        }