public void SendCongratulationsEmail_ShouldSendEmail() { var user = FakeUser(); var service = new UsersService(emailService.Object, mockUsersRepository.Object); emailService.Setup(x => x.Send(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<bool>())).Returns(true); var ret = service.SendRegisterCongratulationsToEmail(user); emailService.Verify(x => x.Send("*****@*****.**", It.IsAny<string>(), It.IsAny<string>(), It.IsAny<bool>()), Times.Once()); Assert.IsTrue(ret); }