Exemplo n.º 1
0
        public async Task CreateUser_Invalid_UserName_Should_Return_Validation_Error()
        {
            var response = await Some.UserService().CreateUserAsync(Some.CreateUserCommand().With(userName: "******"));

            response.ValidationResult.Errors.Should().ContainKey(PropertyName.Get((CreateUserCommand x) => x.UserName));
        }
Exemplo n.º 2
0
        public async Task CreateUser_With_Incorrectly_Repeated_Password_Should_Return_Validation_Error()
        {
            var response = await Some.UserService().CreateUserAsync(Some.CreateUserCommand().With(password: "******", rePassword: "******"));

            response.ValidationResult.Errors.Should().ContainKey(PropertyName.Get((CreateUserCommand x) => x.RepeatedPassword));
        }
Exemplo n.º 3
0
        public async Task CreateUser_Invalid_Email_Should_Return_Validation_Error()
        {
            var response = await Some.UserService().CreateUserAsync(Some.CreateUserCommand().With(email: "invalid"));

            response.ValidationResult.Errors.Should().ContainKey(PropertyName.Get((CreateUserCommand x) => x.Email));
        }