示例#1
0
        public void Validate_GivenAllPropertiesAreValid_ExpectValidationSuccess()
        {
            var request = new UnlockAccountRequest
            {
                UserId = TestVariables.UserId,
            };
            var validator = new UnlockAccountRequest.Validator();
            var result    = validator.Validate(request);

            Assert.True(result.IsValid);
        }
示例#2
0
        public void Validate_GivenNameIsEmpty_ExpectValidationFailure()
        {
            var request = new UnlockAccountRequest
            {
                UserId = Guid.Empty,
            };
            var validator = new UnlockAccountRequest.Validator();
            var result    = validator.Validate(request);

            Assert.False(result.IsValid);
            Assert.Contains(
                result.Errors,
                failure => failure.PropertyName == "UserId");
        }