ucsb-cs156-w24 / proj-happy-cows-w24-4pm-3

https://ucsb-cs156-w24.github.io/proj-happy-cows-w24-4pm-3/
0 stars 0 forks source link

fixed bug of selling negative cow amounts #12

Closed bonniehuynh closed 7 months ago

bonniehuynh commented 7 months ago

Overview

In this PR, the user can no longer sell a negative amount of cows. They are given an error message that says "You cannot sell a negative number of cows!"

Changes deployed at Dokku deployment here: https://happycows-bonniehuynh-dev.dokku-03.cs.ucsb.edu/

Tests

In the UserCommonsControllerTests.java file, I added a function called test_SellCow_commons_exists_sell_negative_cows() to give a bad request if the given a negative number of cows to sell. Screenshot of the test for the bug:

Screenshot 2024-02-29 at 4 40 13 pm

Closes #8

srambhatla30 commented 7 months ago

Matches the way I implemented my changes for the negative buy fix, LGTM.