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

Expanding test cases for Vehicle Purchase exercise in the Go track #2739

Closed
jesse-kroon opened this issue Jan 9, 2024 · 1 comment
Closed

Comments

@jesse-kroon
Copy link
Contributor

I was working on the Vehicle Purchase exercise in the Go track today, and in the description I noticed the following requirement:
"For a rough estimate, assume if the vehicle is less than 3 years old, it costs 80% of the original price it had when it was brand new."

However, when looking at the test cases, I found that there is no test case with an age of exactly 3. This means that the following check also works, while I expect it not to pass

if age < = 3 { // use 80% of original price }

While if age is exactly 3, it should adhere to the following requirement as stated in the description:
"If the vehicle is at least 3 years old but less than 10 years, it costs 70% of the original price."

I would suggest to add the following test case to vehicle_purchase_test.go

{
	name:          "price is reduced to 70% for age 3",
	originalPrice: 40000,
	age:           3,
	expected:      28000,
},
Copy link
Contributor

github-actions bot commented Jan 9, 2024

Hello. Thanks for opening an issue on Exercism 🙂

At Exercism we use our Community Forum, not GitHub issues, as the primary place for discussion. That allows maintainers and contributors from across Exercism's ecosystem to discuss your problems/ideas/suggestions without them having to subscribe to hundreds of repositories.

This issue will be automatically closed. Please use this link to copy your GitHub Issue into a new topic on the forum, where we look forward to chatting with you!

If you're interested in learning more about this auto-responder, please read this blog post.

@github-actions github-actions bot closed this as completed Jan 9, 2024
This issue was closed.
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