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

Extend Fluent API to support adding ModelState #354

Open
HristoHentov opened this issue Dec 8, 2019 · 0 comments
Open

Extend Fluent API to support adding ModelState #354

HristoHentov opened this issue Dec 8, 2019 · 0 comments
Assignees
Labels
Milestone

Comments

@HristoHentov
Copy link
Contributor

We can extend the support for adding errors to the test's model state, with the following extension to the API.

 MyController<MvcController>
    .Instance()
    .WithModelState(modelState => modelState
        .For<RequestModel>()
        .WithErrorFor(m => m.RequiredString, "Some Error")
        .WithErrorFor(m => m.Integer, "Another Error"))

This should add to the current model state's dictionary the following 2 entries:

  1. Entry with key "RequiredString" and a value of "Some Error"
  2. Entry with key "Integer" and a value of "Another Error"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants