public async Task RegisterAsync(UserRegisterDto registerDto) { UserRegister.Command registerCommand = _mapper.Map <UserRegister.Command>(registerDto); await _mediator.Send(registerCommand); CreateEmailConfirmationToken.Command command = _mapper.Map <CreateEmailConfirmationToken.Command>(registerDto); await _mediator.Send(command); }
public async Task Should_Register_User() { var command = new UserRegister.Command { Email = "*****@*****.**", Password = UserSeedData.ValidPassword, UserName = "******", ClientUri = "http://localhost:4200" }; // Act Unit result = await _handler.Handle(command, new CancellationToken()); // Assert result.Should().BeEquivalentTo(Unit.Value); }
public void Should_Map_To_UserRegisterCommand() { // Arrange var dto = new UserRegisterDto { Password = UserSeedData.ValidPassword, Email = UserTestSeedData.Performer.Email, GivenName = "Orsi", Surname = "Aner", UserName = UserTestSeedData.Performer.UserName, ClientUri = "http://localhost:4200" }; // Act UserRegister.Command command = _mapper.Map <UserRegister.Command>(dto); // Assert command.Should().BeEquivalentTo(dto); }
public Person(Guid?id, UserRegister.Command command) : base(id) { GivenName = command.GivenName; Surname = command.Surname; }