Пример #1
0
        public void TestPasswordChangeAppData()
        {
            LapsAgent agent = this.BuildAgent();

            agent.ChangePassword(this.computer.Object);

            lithnetPwdProvider.Verify(v => v.UpdateCurrentPassword(It.IsAny <IComputer>(), It.IsAny <string>(), It.IsAny <DateTime>(), It.IsAny <DateTime>(), It.IsAny <int>(), MsMcsAdmPwdBehaviour.Ignore), Times.Once);
            sam.Verify(v => v.SetLocalAccountPassword(It.IsAny <SecurityIdentifier>(), It.IsAny <string>()));
        }
        public void TestPasswordChangeLaps()
        {
            this.settings.SetupGet(a => a.WriteToMsMcsAdmPasswordAttributes).Returns(true);
            LapsAgent agent = this.BuildAgent();

            agent.ChangePassword(this.computer.Object);

            admPwdProvider.Verify(v => v.SetPassword(It.IsAny <IComputer>(), It.IsAny <string>(), It.IsAny <DateTime>()));
            lithnetPwdProvider.Verify(v => v.UpdateCurrentPassword(It.IsAny <IComputer>(), It.IsAny <string>(), It.IsAny <DateTime>(), It.IsAny <DateTime>(), It.IsAny <int>()), Times.Never);
            sam.Verify(v => v.SetLocalAccountPassword(It.IsAny <SecurityIdentifier>(), It.IsAny <string>()));
        }