Jeremy Skinner, author of FluentValidation, was kind enough to provide me with an explanation on its discussion forum.
Essentially, FluentValidation allows you to test methods, but you have to specify a property name for them because FluentValidation is inherently built to test properties.
So the solution is to take my original validation:
RuleFor(x=>x.IsEmpty())
.NotEqual(true).WithMessage("Worksheet must not be empty.");
...and add an OverridePropertyName()
method onto the end like so:
RuleFor(x=>x.IsEmpty())
.NotEqual(true).WithMessage("Worksheet must not be empty.").OverridePropertyName("IsEmpty");
(As a side note, I very much recommend this library if you need to perform validation on business objects. Very handy, has rarely let me down, and Jeremy is great about supporting the project and its users.)