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); }
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(); }
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); }