public void PromoteToAdminTest() { DoSignUp("MaorRegister11", "Here 3", "123", "12345678"); RegisteredUser adminUser = (RegisteredUser)userServiceSession.MarketUser; object[] expectedData = { adminUser.SystemID, "MaorRegister11", "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.IsFalse(adminUser.HasStorePolicies()); Assert.IsTrue(adminUser.IsRegisteredUser()); Assert.IsTrue(adminUser.IsSystemAdmin()); }
public void SignedInUserPoliciesTest() { DoSignUp("MaorLogin14", "Here 3", "123", "12345678"); userServiceSignInSession.EnterSystem(); Assert.AreEqual((int)SignInStatus.Success, userServiceSignInSession.SignIn("MaorLogin14", "123").Status); RegisteredUser user = (RegisteredUser)userServiceSignInSession.MarketUser; Assert.IsFalse(user.HasStorePolicies()); Assert.IsTrue(user.IsRegisteredUser()); Assert.IsFalse(user.IsSystemAdmin()); }