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

Unit tests for "all-your-base" too strict in exception handling #143

Open
HugoRoss opened this issue Sep 10, 2021 · 2 comments
Open

Unit tests for "all-your-base" too strict in exception handling #143

HugoRoss opened this issue Sep 10, 2021 · 2 comments

Comments

@HugoRoss
Copy link

All unit tests of exercise "all-your-base" that expect an ArgumentException should expect it with Assert.ThrowsAny(Of ArgumentException) instead of Assert.Throws(Of ArgumentException) which then would allow more accurate sub-exceptions like ArgumentOutOfRangeException to be thrown.

@ErikSchierboom
Copy link
Member

That is certainly a valid option. Another would be to change the expected exception to the "proper" exception (e.g. ArgumentOutOfRangeException). I'd be in favor of the latter option, as it better teaches the student which exception is appropriate in which situation. Would you be willing to submit a PR?

@axtens axtens mentioned this issue Jul 19, 2022
@axtens axtens closed this as completed Jul 19, 2022
@axtens axtens reopened this Jul 20, 2022
@axtens
Copy link
Member

axtens commented Jul 20, 2022

Need to resubmit in smaller pieces

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

3 participants