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

Poor support for 'ActionResult<T>' type? #21

Closed
julealgon opened this issue Oct 23, 2020 · 2 comments · Fixed by #23
Closed

Poor support for 'ActionResult<T>' type? #21

julealgon opened this issue Oct 23, 2020 · 2 comments · Fixed by #23

Comments

@julealgon
Copy link

Just started using the library and quickly realized that there is only a single assertion for IActionResult<T>, BeConvertibleTo<T>.

This method doesn't help much when dealing with default responses and values, since you still have to explicitly say what the values and types are. For instance, this seems a bit unintuitive to me:

result.Should().BeConvertibleTo<ObjectResult>().Which.Value.Should().Be(myValue)

I noticed that there are quite a few checks on IActionResult. Shoudn't most of those be ported to work with ActionResult<T> as well?

@faddiv
Copy link
Collaborator

faddiv commented Oct 24, 2020

Hi @julealgon,
When I initially created the IActionResult<T> implementation I was unsure where it should head so I leaved for a while. What I realized that time It is based on ObjectResult but there was no assertion for that so I worked on that in the past months. Next I can go back to this issue.
Any suggestion and help on this topic is a welcome.
By the way it will take a while until it is finished because other things.

@faddiv faddiv linked a pull request Nov 1, 2020 that will close this issue
@faddiv faddiv closed this as completed in #23 Nov 1, 2020
@faddiv
Copy link
Collaborator

faddiv commented Nov 1, 2020

I added some support for the scenario. Now you can do things like this:

result.Should().BeObjectResult()
                .WithValue(model)

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

Successfully merging a pull request may close this issue.

2 participants