Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public Person(Guid?id, UserRegister.Command command) : base(id)
 {
     GivenName = command.GivenName;
     Surname   = command.Surname;
 }