示例#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);
 }
示例#2
0
        public void TestSignUp_service()
        {
            ServiceReference1.SMURentItServiceClient service = new ServiceReference1.SMURentItServiceClient();
            int userId = service.SignUp("*****@*****.**", "TBone", "Fish", false);
            int id = service.LogIn("*****@*****.**", "Fish");

            Assert.AreEqual(userId, id);
        }
示例#3
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);
 }