Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extension methods against ScreenFixture #31

Open
jmarnold opened this issue Jan 2, 2013 · 0 comments
Open

Extension methods against ScreenFixture #31

jmarnold opened this issue Jan 2, 2013 · 0 comments

Comments

@jmarnold
Copy link
Contributor

jmarnold commented Jan 2, 2013

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant