Beispiel #1
0
        public async Task Refresh_Always_RefreshesTvShowProperties()
        {
            // Arrange
            TvShowMetadata metadata = CreateTvShowMetadata();

            _metadataService.Get(Arg.Any <string>())
            .Returns(metadata.ToTask());

            // Act
            await _viewModel.Refresh();

            // Assert
            AssertMetadataEqualsViewModel(metadata);
        }
Beispiel #2
0
        public async Task Refresh_Always_RefreshesImages()
        {
            // Arrange
            _metadataService.Get(_path)
            .Returns(new TvShowMetadata().ToTask());

            ITvShowImagesViewModel imagesViewModel = Substitute.For <ITvShowImagesViewModel>();

            _viewModelFactory.GetTvShowImages(Arg.Any <ITvShowViewModel>(), _path)
            .Returns(imagesViewModel);
            // Recreate the ViewModel as the ImagesViewModel is retrieved in the constructor
            _viewModel = new TvShowViewModel(_viewModelFactory, _tvShowFileService, _metadataService, _busyProvider, null, null, _keyDataStore, _path);

            // Act
            await _viewModel.Refresh();

            // Assert
            imagesViewModel.Received()
            .Refresh().Async();
        }