public void RemoveUserInputFailTest() { DoSignInToAdmin(); adminServiceSession = (SystemAdminService)marketSession.GetSystemAdminService(userServiceSession); Assert.AreEqual((int)RemoveUserStatus.BadInput, adminServiceSession.RemoveUser(badUserName).Status); Assert.IsTrue(MarketException.HasErrorRaised()); }
public void DidntEnterTest() { userServiceRegisteredSession = (UserService)marketSession.GetUserService(); Assert.AreEqual((int)EditCartItemStatus.DidntEnterSystem, userServiceRegisteredSession.EditCartItem("X", "Health Potion", -2, 5.0).Status); Assert.IsTrue(MarketException.HasErrorRaised()); }
public void SignInAfterSignUpTest() { DoSignUp("MaorLogin16", "Here 3", "123", "12345678"); Assert.IsFalse(MarketException.HasErrorRaised()); Assert.AreEqual((int)SignInStatus.SignedInAlready, userServiceSignUpSession.SignIn("MaorLogin16", "123").Status); Assert.IsTrue(MarketException.HasErrorRaised()); }
public void SelfTerminationBlockedTest() { DoSignInToAdmin(); adminServiceSession = (SystemAdminService)marketSession.GetSystemAdminService(userServiceSession); Assert.AreEqual((int)RemoveUserStatus.SelfTermination, adminServiceSession.RemoveUser(adminName).Status); Assert.IsTrue(MarketException.HasErrorRaised()); }
public void SignUpAgainTest() { DoSignUp("MaorRegister9", "Here 3", "123", "12345678"); Assert.IsFalse(MarketException.HasErrorRaised()); Assert.AreEqual((int)SignUpStatus.SignedUpAlready, userServiceSession.SignUp("MaorRegister9", "Here 3", "123", "12345678").Status); Assert.IsTrue(MarketException.HasErrorRaised()); }
private void MissingCredentialsSignUpTest(string name, string address, string password, string creditCard) { Assert.IsFalse(MarketException.HasErrorRaised()); userServiceSession.EnterSystem(); Assert.AreEqual((int)SignUpStatus.NullEmptyFewDataGiven, userServiceSession.SignUp(name, address, password, creditCard).Status); Assert.IsTrue(MarketException.HasErrorRaised()); }
public void NoUserNameTest() { DoSignInToAdmin(); adminServiceSession = (SystemAdminService)marketSession.GetSystemAdminService(userServiceSession); Assert.AreEqual((int)ViewPurchaseHistoryStatus.NoUserFound, adminServiceSession.ViewPurchaseHistoryByUser(noUserName).Status); Assert.IsTrue(MarketException.HasErrorRaised()); }
public void NoUserToRemoveFoundTest() { DoSignInToAdmin(); adminServiceSession = (SystemAdminService)marketSession.GetSystemAdminService(userServiceSession); Assert.AreEqual((int)RemoveUserStatus.NoUserFound, adminServiceSession.RemoveUser(noUserName).Status); Assert.IsTrue(MarketException.HasErrorRaised()); }
public void DidntEnteredSystemTest() { Assert.IsFalse(MarketException.HasErrorRaised()); Assert.AreEqual((int) SignUpStatus.DidntEnterSystem, userServiceSession.SignUp("MaorRegister6", "Here 3", "123", "12345678").Status); Assert.IsTrue(MarketException.HasErrorRaised()); }
public void DidntSignUpTest() { Assert.IsFalse(MarketException.HasErrorRaised()); userServiceSignInSession.EnterSystem(); Assert.IsFalse(MarketException.HasErrorRaised()); Assert.AreEqual((int)SignInStatus.NoUserFound, userServiceSignInSession.SignIn("MaorLogin12", "123").Status); Assert.IsTrue(MarketException.HasErrorRaised()); }
private void RegisteredUserDataTest(string name, string address, string password, string creditCard) { DoSignUp(name, address, password, creditCard); Assert.IsFalse(MarketException.HasErrorRaised()); RegisteredUser registeredUser = (RegisteredUser)userServiceSession.MarketUser; object[] expectedData = { registeredUser.SystemID, name, address, UserSecurityService.GetSecuredPassword(password),creditCard }; Assert.IsTrue(expectedData.SequenceEqual(registeredUser.ToData())); }
private void BadCredentialsSignInTest(string name, string address, string password, string creditCard, string loginName, string loginPassword) { DoSignUp(name, address, password, creditCard); Assert.IsFalse(MarketException.HasErrorRaised()); userServiceSignInSession.EnterSystem(); Assert.AreEqual((int)SignInStatus.NoUserFound, userServiceSignInSession.SignIn(loginName, loginPassword).Status); Assert.IsTrue(MarketException.HasErrorRaised()); }
public void SignUpWithExistedName() { Assert.IsFalse(MarketException.HasErrorRaised()); DoSignUp("MaorRegister10", "Here 3", "123", "12345678"); Assert.IsFalse(MarketException.HasErrorRaised()); userServiceSession2 = (UserService)marketSession.GetUserService(); userServiceSession2.EnterSystem(); Assert.IsFalse(MarketException.HasErrorRaised()); Assert.AreEqual((int)SignUpStatus.TakenName, userServiceSession2.SignUp("MaorRegister10", "Here 3", "123", "12345678").Status); Assert.IsTrue(MarketException.HasErrorRaised()); }
public void PurchaseHistoryOfStoreTest() { DoSignInToAdmin(); adminServiceSession = (SystemAdminService)marketSession.GetSystemAdminService(userServiceSession); string[] expectedHistory = { new PurchaseHistory(userNameToView1, "INT Potion", storeNameToView2, "Lottery", 2, 8.0, "29/12/2018").ToString(), new PurchaseHistory(userNameToView1, "Mana Potion", storeNameToView2, "Lottery", 3, 12.0, "29/12/2018").ToString(), new PurchaseHistory(userNameToView2, "STR Potion", storeNameToView2, "Immediate", 1, 4.0, "29/12/2018").ToString(), }; Assert.AreEqual((int)ViewPurchaseHistoryStatus.Success, adminServiceSession.ViewPurchaseHistoryByStore(storeNameToView2).Status); Assert.IsTrue(adminServiceSession.ViewPurchaseHistoryByStore(storeNameToView2).ReportList.SequenceEqual(expectedHistory)); Assert.IsFalse(MarketException.HasErrorRaised()); }
private void DoSignUpSignIn(string name, string address, string password, string creditCard) { DoSignUp(name, address, password, creditCard); Assert.IsFalse(MarketException.HasErrorRaised()); DoSignIn(name, password); }
public void GoodLoginTest1() { DoSignUpSignIn("MaorLogin1", "Here 4", "123", "12345678"); Assert.IsFalse(MarketException.HasErrorRaised()); }
public void BadRegisterTest() { userServiceSession.EnterSystem(); Assert.AreEqual((int)SignUpStatus.BadInput, userServiceSession.SignUp("Ma'orRegister1", "Here 3", "123", "12345678").Status); Assert.IsTrue(MarketException.HasErrorRaised()); }
public void GoodRegisterTest() { DoSignUp("MaorRegister1", "Here 3", "123", "12345678"); Assert.IsFalse(MarketException.HasErrorRaised()); }
public void BadLoginTest() { userServiceSignInSession.EnterSystem(); Assert.AreEqual((int)SignInStatus.BadInput, userServiceSignInSession.SignIn("MaorLo'gin1", "123").Status); Assert.IsTrue(MarketException.HasErrorRaised()); }
public void DidntEnteredSystemTest() { Assert.IsFalse(MarketException.HasErrorRaised()); Assert.AreEqual((int)SignInStatus.DidntEnterSystem, userServiceSignInSession.SignIn("MaorLogin11", "123").Status); Assert.IsTrue(MarketException.HasErrorRaised()); }
public void DidntEnterTest() { userServiceRegisteredSession = (UserService)marketSession.GetUserService(); Assert.AreEqual((int)ViewCartStatus.DidntEnterSystem, userServiceRegisteredSession.ViewCart().Status); Assert.IsTrue(MarketException.HasErrorRaised()); }