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

Bug: ConfigureWithDataAnnotationsValidation should have access the IConfiguration instance #8

Closed
kdcllc opened this issue Feb 28, 2019 · 0 comments · Fixed by #9
Closed
Labels
bug Something isn't working

Comments

@kdcllc
Copy link
Owner

kdcllc commented Feb 28, 2019

Previous usage:

 services.ConfigureWithDataAnnotationsValidation<FakeOptionsWithDatatAnnotations>(sectionName: "FakeOptions");

Throws exception even if there are valid values

Value = '((Microsoft.Extensions.Options.OptionsManager<Bet.AspNetCore.UnitTest.FakeOptionsWithDatatAnnotations>)options).Value' threw an exception of type 'Microsoft.Extensions.Options.OptionsValidationException'

Should be:

  services.ConfigureWithDataAnnotationsValidation<FakeOptionsWithDatatAnnotations>(Configuration, sectionName: "FakeOptions");

Must add a positive unit test scenario as well to test a happy path.

@kdcllc kdcllc added the bug Something isn't working label Feb 28, 2019
kdcllc added a commit that referenced this issue Feb 28, 2019
kdcllc added a commit that referenced this issue Feb 28, 2019
fix the bug closes issue #8
@kdcllc kdcllc closed this as completed Feb 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant