Esempio n. 1
0
        public void SignUpWithExistedName()
        {
            userDbMocker.Setup(x => x.IsUserNameExist(It.IsAny <string>())).Returns(true);
            slave = new SignUpSlave(guestUser, userDbMocker.Object, publisherMocker.Object);
            User user = slave.SignUp(registeredUserName, registeredUserAddress, registeredUserPassword,
                                     registeredUserCreditCard);

            BadSignUpToDataCompare(user);
        }
Esempio n. 2
0
        public void DidntEnteredSystemTest()
        {
            slave = new SignUpSlave(null, userDbMocker.Object, publisherMocker.Object);
            User user = slave.SignUp(registeredUserName, registeredUserAddress, registeredUserPassword,
                                     registeredUserCreditCard);

            Assert.IsNull(user);
            Assert.AreEqual(0, counterQueueAdded);
        }
Esempio n. 3
0
        public void SignUpAgainTest()
        {
            User user = slave.SignUp(registeredUserName, registeredUserAddress, registeredUserPassword, registeredUserCreditCard);

            slave = new SignUpSlave(user, userDbMocker.Object, publisherMocker.Object);
            user  = slave.SignUp("some other name", registeredUserAddress, registeredUserPassword,
                                 registeredUserCreditCard);
            object[] expected = { registeredUserID, registeredUserName, registeredUserAddress, encryptedUserPassword,
                                  registeredUserCreditCard };
            object[] actual = user.ToData();
            CompareUserToData(expected, actual);
            Assert.AreEqual(1, counterQueueAdded);
        }
Esempio n. 4
0
        public void RegisteredUserIsRegisteredTest()
        {
            User user = slave.SignUp(registeredUserName, registeredUserAddress, registeredUserPassword,
                                     registeredUserCreditCard);

            Assert.IsFalse(user.HasStorePolicies());
            Assert.IsFalse(user.IsSystemAdmin());
            Assert.IsTrue(user.IsRegisteredUser());
            Assert.AreEqual(1, counterQueueAdded);
        }