The values in currency are null, but ModelState.IsValid is true, weird.
This is completely normal behavior. The validator checks for a string length, not whether a property is null. Documentation:
Ensures that the length of a particular string property is within the specified range.
If you do not want to allow null values you should use NotNull validator:
RuleFor(x => x.Code).NotNull().Length(3);
RuleFor(x => x.Name).NotNull().Length(3, 50);