Extension methods against ScreenFixture
Opened this issue · 0 comments
jmarnold commented
Putting this here before I forget:
Much like we have the "EditableElementsForAllImmediateProperties()" in the ScreenFixture, I'm thinking that we enable a mechanism to do the same modifications through extension methods.
Example:
[FormatAs("There are no validation messages")]
public bool NoMessages()
{
return !validation.AllMessages().Any();
}
[FormatAs("The validation summary is not shown")]
public bool NoSummary()
{
return validation.Hidden;
}
public IGrammar VerifyValidationMessages()
{
return VerifySetOf(() => validation.AllMessages())
.Titled("Verify the validation messages")
.MatchOn(x => x.Property, x => x.Message);
}
That's WAY too common to write in every fixture. It'd be nice to be able to inject the grammars via an extension method you can call in the fixture ctor. Maybe?