コード例 #1
0
        public void GetAllShows()
        {
            //Arange
            var service = new ShowService();
            var show = new Show
            {
                Name = "Test Retrieval",
                Description = "Retrieved Show",
                ThumbnailUrl = "https://upload.wikimedia.org/wikipedia/en/1/18/Shaw_Media_Logo_2012.png",
                VideoUrl = "http://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_1mb.mp4"
            };
            var addedShow = service.Post(show);

            //Act
            var retrievedShows = service.GetAllShows();

            //Assert
            Assert.IsTrue(retrievedShows.Count() > 0);
            var showsWithId = retrievedShows.Where(s => s.Id == addedShow.Id);
            Assert.AreEqual(showsWithId.Count(), 1);
            var showWithId = showsWithId.First();

            Assert.AreEqual(showWithId.Id, addedShow.Id);
            Assert.AreEqual(showWithId.Name, addedShow.Name);
            Assert.AreEqual(showWithId.Description, addedShow.Description);
            Assert.AreEqual(showWithId.ThumbnailUrl, addedShow.ThumbnailUrl);
            Assert.AreEqual(showWithId.VideoUrl, addedShow.VideoUrl);
        }