public void TestRecycleMode() { MockUser user = new MockUser("TestUser", "TestPassword", "MyNewPassword"); PasswordChanger pc = new PasswordChanger(user, update, errorHandle, 1, 2); pc.ChangePasswordRecycleMode(); Assert.AreEqual(user.NewPassword, user.Password); }
public void TestRecycleModeNoIterations() { MockUser user = new MockUser("TestUser", "TestPassword", "MyNewPassword"); PasswordChanger pc = new PasswordChanger(user, update, errorHandle); try { pc.ChangePasswordRecycleMode(); } catch (Exception ex) { string expected = "Iterations must be set when recycling a password. \n\n(Choose the corresponding number of previous passwords kept by your domain)"; Assert.AreEqual(expected, ex.Message); } }