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); }
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"); }