Exemple #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);
        }
Exemple #2
0
        public async Task Update_WhenMetadataAlreadyExists_DoesNothing()
        {
            // Arrange
            TvShowMetadata metadata = CreateTvShowMetadata();

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

            // Act
            await _viewModel.Update();

            // Assert
            _metadataService.DidNotReceiveWithAnyArgs()
            .Update(_path).Async();
        }
Exemple #3
0
        public async Task Update_WhenNoMetadataAlreadyExists_RetrievesFreshMetadata()
        {
            // Arrange
            TvShowMetadata metadata = CreateTvShowMetadata();

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

            // Act
            IEnumerable <ProgressItem> items = await _viewModel.Update();

            ProgressItem item = items.First();
            await item.Execute();

            // Assert
            _metadataService.Received()
            .Update(_path).Async();
            AssertMetadataEqualsViewModel(metadata);
        }