Example #1
0
 public void RentBookTest_service()
 {
     ServiceReference1.SMURentItServiceClient service = new ServiceReference1.SMURentItServiceClient();
     int bookId = service.UploadBook("Peter PLys", "A. A. Milne", "gbook", "religious", 1000.0, new MemoryStream());
     service.UploadPdf(bookId, new System.IO.MemoryStream());
     int userId = service.SignUp("*****@*****.**", "userman", "abekat1", false);
     int rentId = service.RentBook(userId, bookId, 0);
 }
Example #2
0
 public void TestGetRental_service()
 {
     ServiceReference1.SMURentItServiceClient service = new ServiceReference1.SMURentItServiceClient();
     int bookId = service.UploadBook("Sasdasd", "SP", "gods book", "religious", 1000.0, new MemoryStream());
     service.UploadPdf(bookId, new System.IO.MemoryStream());
     int userId = service.SignUp("sdfsdfgdsg","sdgsdg","sdsdgsdgsdggsd",false);
     int rentalId = service.RentBook(userId, bookId, 0);
     Rental[] rentals = service.GetRental(userId, bookId);
     service.DeleteAccount(userId);
     Assert.AreEqual(rentalId, rentals[0].Id);
     Assert.AreEqual(0, rentals[0].MediaType);
 }
Example #3
0
        public void UploadPDFTest_service()
        {
            ServiceReference1.SMURentItServiceClient service = new ServiceReference1.SMURentItServiceClient();
            int bookId = service.UploadBook("Sean Paul bio", "SP", "gods book", "religious", 1000.0, new MemoryStream());
            service.UploadPdf(bookId, new System.IO.MemoryStream());
            try
            {
                service.UploadPdf(Int32.MaxValue, new System.IO.MemoryStream());
                Assert.Fail(); // must fail
            }
            catch (Exception)
            {

            }
        }