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())); }
public void PromoteToAdminTest() { DoSignUpSignIn("MaorLogin17", "Here 3", "123", "12345678"); RegisteredUser adminUser = (RegisteredUser)userServiceSignInSession.MarketUser; object[] expectedData = { adminUser.SystemID, "MaorLogin17", "Here 3", UserSecurityService.GetSecuredPassword("123"), "12345678" }; Assert.IsTrue(expectedData.SequenceEqual(adminUser.ToData())); Assert.IsTrue(adminUser.IsRegisteredUser()); Assert.IsFalse(adminUser.IsSystemAdmin()); Assert.IsFalse(adminUser.HasStorePolicies()); adminUser.PromoteToAdmin(); Assert.AreEqual(0, adminUser.Cart.GetCartStorage().Length); Assert.IsTrue(expectedData.SequenceEqual(adminUser.ToData())); Assert.IsTrue(adminUser.IsRegisteredUser()); Assert.IsTrue(adminUser.IsSystemAdmin()); Assert.IsFalse(adminUser.HasStorePolicies()); }
public void GoodLoginDataTest() { DoSignUpSignIn("MaorLogin2", "Here 4", "123", "12345678"); object[] loggedUserData = ((RegisteredUser)userServiceSignInSession.MarketUser).ToData(); object[] registeredUserData = ((RegisteredUser)userServiceSignUpSession.MarketUser).ToData(); object[] expectedData = { loggedUserData[0], "MaorLogin2", "Here 4", UserSecurityService.GetSecuredPassword("123"), "12345678" }; Assert.IsTrue(loggedUserData.SequenceEqual(registeredUserData)); Assert.IsTrue(loggedUserData.SequenceEqual(expectedData)); }