Exemplo n.º 1
0
        public void GetAlbumInfoTest3()
        {
            RentItClient target = new RentItClient();
            int id = -10;

            AlbumInfo actual = target.GetAlbumInfo(id);
        }
Exemplo n.º 2
0
        public void GetAlbumInfoTest2()
        {
            RentItClient target = new RentItClient();

            // The album indentified by id 78 has only 2 songs.
            int id = 78;
            AlbumInfo actual = target.GetAlbumInfo(id);

            Assert.AreEqual(2, actual.Songs.Length);
        }
Exemplo n.º 3
0
        public void GetAlbumInfoTest1()
        {
            RentItClient target = new RentItClient();

            // Get the album indentified by the media id 78.
            int id = 78;
            AlbumInfo actual = target.GetAlbumInfo(id);

            Assert.AreNotEqual(null, actual);
            Assert.AreEqual("The Cure", actual.AlbumArtist);
            Assert.AreEqual("The Greatest Hits", actual.Title);
        }
Exemplo n.º 4
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);
        }