public override bool Equals(object obj) { RatingResult rr = obj as RatingResult; if (rr == null) { return(false); } return(Title == rr.Title && Year == rr.Year && Rating == rr.Rating); }
public void It_should_get_a_rating_result() { RatingResult expectedResult = new RatingResult { Rating = "8.0", Title = "In the Heat of the Night", Year = "1967", Poster = @"http://ia.media-imdb.com/images/M/MV5BMTk3NjkxMDc1MV5BMl5BanBnXkFtZTcwMDIwMjI0NA@@._V1_SX300.jpg" }; Assert.AreEqual(ratingService.GetRating("tt0061811", new MockHttpService(OmdbapiResult)), expectedResult); }
private void WriteResultToCache(string imdbId, RatingResult result, IFileSystem fileSystem) { string json = JsonConvert.SerializeObject(result, Formatting.Indented); fileSystem.File.WriteAllText(JsonCacheFilePath(imdbId,fileSystem), json); }
protected virtual void updateRatingResultCache(Action onComplete) { ratingResultCache = getRatingSafe(); onComplete(); }