public void When_AddParent_WithACorrectAge_And_SendEmail() { //Arrange var fixture = new Fixture(); var user = fixture.Build <UserDto>() .Without <DateTime>(p => p.BirthDate) .Without <RoleUserEnum>(p => p.Role) .Without <string>(p => p.Email) .Create(); user.BirthDate = DateTime.UtcNow.AddYears(18); user.Role = RoleUserEnum.Parent; user.Email = "*****@*****.**"; _userBussinesLogic = new UserBussinesLogic(_userRepository.Object, _mockUoW.Object, _emailConfigurationRepository.Object, _appconfigurationRepository.Object); Action act = () => _userBussinesLogic.CreateNewUserAndSendConfirmationEmail(user); act.Should().NotThrow <Exception>(); _userRepository.Verify(p => p.Add(It.IsAny <User>()), Times.Once); _appconfigurationRepository.Verify(p => p.GetById(It.IsAny <int>()), Times.Once); _emailConfigurationRepository. Verify(e => e.AddEmailConfirmation(It.IsAny <string>(), It.IsAny <int>(), It.IsAny <Guid>(), It.IsAny <TimeSpan>()), Times.Once); }
public UserConfirmationController(IMapper mapper, IUserBussinesLogic userBussinesLogic) { _mapper = mapper; _userBussinesLogic = userBussinesLogic; }
public UserController(IMapper mapper, IUserBussinesLogic userBussinesLogic) { this._userBussinesLogic = userBussinesLogic; this._mapper = mapper; }