Ejemplo n.º 1
0
        public void GetBookInfoTest1()
        {
            RentItClient target = new RentItClient();

            int id = 81;
            BookInfo actual = target.GetBookInfo(id);

            Assert.AreEqual("Power Commands for Visual Studio", actual.Title);
        }
Ejemplo n.º 2
0
        public void UpdateMediaMetadataTest()
        {
            RentItClient target = new RentItClient();
            AccountCredentials credentials = new AccountCredentials {
                UserName = "******",
                HashedPassword = "******"
            };

            int mediaId = 10; // Kraftwerk - "The Man-Machine" album
            AlbumInfo newAlbumData = target.GetAlbumInfo(mediaId);
            string albumArtist = newAlbumData.AlbumArtist;
            newAlbumData.AlbumArtist = newAlbumData.AlbumArtist == "Kraftwerk" ? "Craftwork" : "Kraftwerk";
            bool actual = target.UpdateMediaMetadata(newAlbumData, credentials);
            string updatedAlbumArtist = target.GetAlbumInfo(mediaId).AlbumArtist;
            Assert.IsTrue(actual);
            Assert.IsTrue(albumArtist == "Kraftwerk"? "Craftwork" == updatedAlbumArtist : "Kraftwerk" == updatedAlbumArtist);

            mediaId = 1; // "The Room"
            MovieInfo newMovieData = target.GetMovieInfo(mediaId);
            string director = newMovieData.Director;
            newMovieData.Director = newMovieData.Director == "Tommy Wiseau" ? "Timmy Wiseau" : "Tommy Wiseau";
            actual = target.UpdateMediaMetadata(newMovieData, credentials);
            string updatedDirector = target.GetMovieInfo(mediaId).Director;
            Assert.IsTrue(actual);
            Assert.IsTrue(director == "Tommy Wiseau" ? "Timmy Wiseau" == updatedDirector : "Tommy Wiseau" == updatedDirector);

            mediaId = 2; // "House of Leaves"
            BookInfo newBookData = target.GetBookInfo(mediaId);
            string author = newBookData.Author;
            newBookData.Author = newBookData.Author == "Mark Z. Danielewsky" ? "Mak Z. Danielewsky" : "Mark Z. Danielewsky";
            actual = target.UpdateMediaMetadata(newBookData, credentials);
            string updatedAuthor = target.GetBookInfo(mediaId).Author;
            Assert.IsTrue(actual);
            Assert.IsTrue(author == "Mark Z. Danielewsky" ? "Mak Z. Danielewsky" == updatedAuthor : "Mark Z. Danielewsky" == updatedAuthor);
        }
Ejemplo n.º 3
0
        public void GetBookInfoTest3()
        {
            RentItClient target = new RentItClient();

            int id = 78;
            BookInfo actual = target.GetBookInfo(id);
        }