コード例 #1
0
    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);
    }
コード例 #2
0
    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);
            }
    }