コード例 #1
0
        public void UpdateShow()
        {
            //Arrange
            var service = new ShowService();
            var show = new Show
            {
                Name = "Test Creation",
                Description = " Created Show",
                ThumbnailUrl = "https://upload.wikimedia.org/wikipedia/en/thumb/f/fa/Shaw_Communications_logo_(1997).svg/220px-Shaw_Communications_logo_(1997).svg.png",
                VideoUrl = "http://techslides.com/demos/sample-videos/small.mp4"
            };
            var addedShow = service.Post(show);

            //Act
            var ShowToUpdate = addedShow;
            ShowToUpdate.Name = "Updated Name";
            ShowToUpdate.Description = "Updated Description";
            ShowToUpdate.ThumbnailUrl = "https://upload.wikimedia.org/wikipedia/en/1/18/Shaw_Media_Logo_2012.png";
            ShowToUpdate.VideoUrl = "http://videoupdate.com";

            var updatedShow = service.Put(ShowToUpdate);

            //Assert
            Assert.AreEqual(updatedShow.Id, ShowToUpdate.Id);
            Assert.AreEqual(updatedShow.Name, ShowToUpdate.Name);
            Assert.AreEqual(updatedShow.Description, ShowToUpdate.Description);
            Assert.AreEqual(updatedShow.ThumbnailUrl, show.ThumbnailUrl);
            Assert.AreEqual(updatedShow.VideoUrl, show.VideoUrl);
        }