Пример #1
0
        public async Task Write_WithTestData()
        {
            var memStream = new MemoryStream();
            var writer    = new PlaylistContainerWriter(memStream);
            var progress  = Substitute.For <IProgress <(double?, string)> >();

            await writer.Write(PlaylistContainerTestData.Data, progress);

            await writer.Flush();

            memStream.Should().Equal(Resource.AsStream("test.container"));
        }
Пример #2
0
        //[Test]
        public async Task WriteTestData()
        {
            Console.WriteLine(Environment.CurrentDirectory);
            var progress = Substitute.For <IProgress <(double?, string)> >();
            var fullPath = Path.GetFullPath(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "test.container"));

            Console.WriteLine($"Writing test container to {fullPath}");
            using (var writer = new PlaylistContainerWriter(fullPath))
            {
                await writer.Write(PlaylistContainerTestData.Data, progress);

                await writer.Flush();
            }
        }