Exemplo n.º 1
0
        public void ParseTopp100JsonTest()
        {
            var logicHandler = new LogicHandler();
            var testJson     = "[{'title': 'The Shawshank Redemption', 'id': 'tt0111161', 'rated': '9,2'}]";
            var expected     = new Movie()
            {
                Id = "tt0111161", Title = "The Shawshank Redemption", Rated = 9.2
            };

            var actual = logicHandler.ParseTop100JsonToMovieObjects(testJson).Single();

            Assert.AreEqual(expected.Id, actual.Id);
            Assert.AreEqual(expected.Title, actual.Title);
            Assert.AreEqual(expected.Rated, actual.Rated);
        }