private void AddShowToDatabase(TVShowFromTVDBDto newShowDto) { TVShow newShow = newShowDto.ToTVShow(); newShow.IsActive = true; Log.Information($"Adding seriesId {newShow.SeriesId}: {newShow.SeriesName} to Shows table"); _showService.Add(newShow); }
public void ConvertToTVShow_ValidShowNoPreferred_Passes() { TVShowFromTVDBDto newShow = new TVShowFromTVDBDto() { SeriesId = 356640, SeriesNameTVDB = "Russian Doll" }; int expectedSeriesId = 356640; string expectedSeriesName = "Russian Doll"; var result = newShow.ToTVShow(); Assert.Equal(expectedSeriesId, result.SeriesId); Assert.Equal(expectedSeriesName, result.SeriesName); Assert.Null(result.SeriesNamePreferred); }
public void ConvertToTVShow_ValidShowWithPreferred_Passes() { TVShowFromTVDBDto newShow = new TVShowFromTVDBDto() { SeriesId = 281662, SeriesNameTVDB = "Marvel's Daredevil", SeriesNamePreferred = "Daredevil" }; int expectedSeriesId = 281662; string expectedSeriesName = "Marvel's Daredevil"; string expectedPreferredName = "Daredevil"; var result = newShow.ToTVShow(); Assert.Equal(expectedSeriesId, result.SeriesId); Assert.Equal(expectedSeriesName, result.SeriesName); Assert.Equal(expectedPreferredName, result.SeriesNamePreferred); }