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); }
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); }
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); }
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); }