public void ValidateChangePassword_PasswordController_MoqTest() { PasswordMessage.Add(UsernameCannotBeBlankViolation); PasswordMessage.Add(PasswordCannotBeBlankViolation); mockIPasswordQueryService.Setup(x => x.GetPolicyViolations(It.IsAny <Guid>(), null)) .Returns(PasswordMessage); var controller = new PasswordController(mockIPasswordQueryService.Object); List <string> actionResult = controller.ValidateChangePassword(It.IsAny <ChangePasswordRequest>()); Assert.AreEqual(PasswordMessage[0], actionResult[0]); }