public async Task EncodingProgressTest2()
        {
            MemoryStream outputStream = new MemoryStream();

            platform.WriteFileFunc = _ => outputStream;
            fileSystem.EnumFileSystemEntriesFunc = _ => {
                return(new[] {
                    new FileSystemEntry(FileSystemEntryType.Directory, "dir", @"C:\dir\"),
                    new FileSystemEntry(FileSystemEntryType.File, "f1.dat", @"C:\dir\f1.dat"),
                    new FileSystemEntry(FileSystemEntryType.File, "f2.dat", @"C:\dir\f2.dat"),
                    new FileSystemEntry(FileSystemEntryType.File, "f3.dat", @"C:\dir\f3.dat"),
                });
            };
            platform.ReadFileFunc = x => {
                switch (x)
                {
                case @"C:\dir\f1.dat": return(new MemoryStream(new byte[200 * 1024]));

                case @"C:\dir\f2.dat": return(new MemoryStream(new byte[300 * 1024]));

                case @"C:\dir\f3.dat": return(new MemoryStream(new byte[2 * 1024]));

                default: throw new NotImplementedException();
                }
            };

            TestEncodingProgress progress = new TestEncodingProgress();
            await service.EncodeAsync(@"C:\dir\", @"C:\outputFile.dat", CancellationToken.None, progress);

            int[] expectedValues =
            {
                -1, 0, 25, 50, 76, 100
            };
            string[] expectedMessages =
            {
                "[Build encoding token]",
                "[Start]",
                @"C:\dir\f1.dat",
                @"C:\dir\f2.dat",
                @"C:\dir\f2.dat",
                "[Finish]"
            };
            CollectionAssert.AreEqual(expectedValues, progress.ValueList);
            CollectionAssert.AreEqual(expectedMessages, progress.MessageList);
        }
        public async Task EncodingProgressTest1()
        {
            MemoryStream outputStream = new MemoryStream();

            platform.WriteFileFunc = _ => outputStream;
            fileSystem.EnumFileSystemEntriesFunc = _ => {
                return(new[] {
                    new FileSystemEntry(FileSystemEntryType.Directory, "dir", @"C:\dir\", 2),
                    new FileSystemEntry(FileSystemEntryType.File, "f1.dat", @"C:\dir\f1.dat"),
                    new FileSystemEntry(FileSystemEntryType.File, "f2.dat", @"C:\dir\f2.dat"),
                    new FileSystemEntry(FileSystemEntryType.File, "f3.dat", @"C:\dir\f3.dat"),
                });
            };
            platform.ReadFileFunc = x => new MemoryStream(new byte[0]);

            TestEncodingProgress progress = new TestEncodingProgress();
            await service.EncodeAsync(@"C:\dir\", @"C:\outputFile.dat", CancellationToken.None, progress);

            CollectionAssert.AreEqual(new[] { -1, 0, 100 }, progress.ValueList);
            CollectionAssert.AreEqual(new[] { "[Build encoding token]", "[Start]", "[Finish]" }, progress.MessageList);
        }