Exemplo n.º 1
0
        public void DeleteMediaTest1()
        {
            RentItClient target = new RentItClient();
            int mediaId = 3; // Kraftwerk - The Robots
            AccountCredentials credentials = new AccountCredentials {
                UserName = "******",
                HashedPassword = "******"
            };
            bool expected = true;
            bool actual = target.DeleteMedia(mediaId, credentials);
            Assert.AreEqual(expected, actual);

            var db = new RentItTestDatabase.RentItDatabaseDataContext();

            // clean up
            var deletedMedia = (from m in db.Medias
                                where m.id == mediaId
                                select m).Single();
            deletedMedia.active = true;
            db.SubmitChanges();
        }
Exemplo n.º 2
0
        public void DeleteMediaTest2()
        {
            RentItClient target = new RentItClient();
            int mediaId = 2; // "House of Leaves"
            AccountCredentials credentials = new AccountCredentials {
                UserName = "******",
                HashedPassword = "******"
            };

            target.DeleteMedia(mediaId, credentials); // InvalidCredentialsException
        }
Exemplo n.º 3
0
 public void DeleteMediaTest3()
 {
     RentItClient target = new RentItClient();
     int mediaId = 90000; // non-existant
     AccountCredentials credentials = new AccountCredentials {
         UserName = "******",
         HashedPassword = "******"
     };
     target.DeleteMedia(mediaId, credentials); // InvalidCredentialsException
 }