Пример #1
0
        public void Should_Fail_On_Invalid_Email()
        {
            var validator   = new RecoverPasswordRequestValidator();
            var mockRequest = new RecoverPasswordRequest()
            {
                Email = "testtesttesttest",
            };

            var result = validator.Validate(mockRequest);

            result.IsValid.Should().Be(false);
            result.Errors.FirstOrDefault(e => e.ErrorMessage == errorMessage).Should().NotBeNull();
        }
Пример #2
0
        public void Should_Pass_On_Correct_Request()
        {
            var validator   = new RecoverPasswordRequestValidator();
            var mockRequest = new RecoverPasswordRequest()
            {
                Email = "*****@*****.**"
            };

            var result = validator.Validate(mockRequest);

            result.IsValid.Should().Be(true);
            result.Errors.Count.Should().Be(0);
        }