Пример #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));
        }
Пример #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));
        }
Пример #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));
        }