示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
 private void WriteResultToCache(string imdbId, RatingResult result, IFileSystem fileSystem)
 {
     string json = JsonConvert.SerializeObject(result, Formatting.Indented);
     fileSystem.File.WriteAllText(JsonCacheFilePath(imdbId,fileSystem), json);
 }
示例#4
0
 protected virtual void updateRatingResultCache(Action onComplete)
 {
     ratingResultCache = getRatingSafe();
     onComplete();
 }