Example #1
0
        public async Task Read_WithTestDataAsFile()
        {
            var reader = new PlaylistContainerReader(filePath);

            var result = await reader.Read();

            result.Should().BeEquivalentTo(PlaylistContainerTestData.Data);
        }
Example #2
0
        public async Task Read_WithTestDataAsStream()
        {
            var stream = Resource.AsStream("test.container");
            var reader = new PlaylistContainerReader(stream);

            var result = await reader.Read();

            result.Should().BeEquivalentTo(PlaylistContainerTestData.Data);
        }
        public async Task Load(string path)
        {
            try
            {
                mainViewModel.LoadedPlaylist = await PlaylistContainerReader.Read(path);

                Settings.Default.LastLoadedPlaylistContainerFile = path;
                Settings.Default.Save();
            }
            catch
            {
                Settings.Default.LastLoadedPlaylistContainerFile = null;
                Settings.Default.Save();
                throw;
            }
        }