Пример #1
0
        public void AddCreditsTest()
        {
            RentItClient target = new RentItClient();
            AccountCredentials credentials = new AccountCredentials {
                UserName = "******",
                HashedPassword = "******"
            };
            int oldCredits = target.GetAllCustomerData(credentials).Credits;

            uint addAmount = 100;
            bool expected = true;
            bool actual = target.AddCredits(credentials, addAmount);
            Assert.AreEqual(expected, actual);

            int newCredits = target.GetAllCustomerData(credentials).Credits;
            Assert.AreEqual(oldCredits + addAmount, newCredits);
        }
Пример #2
0
 public void GetAllCustomerDataExceptionTestTwo()
 {
     RentItClient target = new RentItClient();
     AccountCredentials credentials = new AccountCredentials
     {
         UserName = "******",
         HashedPassword = "******"
     };
     target.GetAllCustomerData(credentials);
 }
Пример #3
0
 public void GetAllCustomerDataExceptionTestOne()
 {
     RentItClient target = new RentItClient();
     AccountCredentials credentials = new AccountCredentials
     {
         UserName = "******",
         HashedPassword = "******"
     };
     target.GetAllCustomerData(credentials);
 }
Пример #4
0
 public void GetAllCustomerDataTest()
 {
     RentItClient target = new RentItClient();
     AccountCredentials credentials = new AccountCredentials
     {
         UserName = "******",
         HashedPassword = "******"
     };
     UserAccount actual = target.GetAllCustomerData(credentials);
     Assert.AreEqual("user21", actual.UserName);
     Assert.AreEqual("*****@*****.**", actual.Email);
     Assert.AreEqual("user21", actual.FullName);
     Assert.AreEqual("a1881c06eec96db9901c7bbfe41c42a3f08e9cb4", actual.HashedPassword);
     Assert.AreEqual(0, actual.Credits);
 }
Пример #5
0
        public void UpdateAccountInfoTest1()
        {
            RentItClient target = new RentItClient();
            AccountCredentials credentials = new AccountCredentials {
                UserName = "******",
                HashedPassword = "******"
            };
            Account account = target.GetAllCustomerData(credentials);
            string oldEmail = account.Email;
            account.Email += "+";

            bool expected = true;
            bool actual = target.UpdateAccountInfo(credentials, account);
            Assert.AreEqual(expected, actual);

            string newEmail = target.GetAllCustomerData(credentials).Email;
            Assert.AreEqual(oldEmail + "+", newEmail);
        }