-
Notifications
You must be signed in to change notification settings - Fork 12
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
(10 points) One order, fulfilled by TWO markets, 2 bills paid in full. #104
Comments
I'm a little stuck on this too. I think the way we are supposed to interpret is if the Cook wants two chickens and MarketA has 1 and MarketB has 1, they will both be called upon to fill the order. The problem in my case is that this is much more a test of the CookAgent in asking the MarketAgents of the correct orders then actually the CashierAgent fitting the bill. In my implementation, for instance, the above scenario would become two separate orders that I would pass to separate Markets, which would independently ask the Cashier for payment. In essence, my understanding of this unit test in the context of my implementation degenerates into two independent cases of the first unit test - one order fulfilled by one market, paid in full - which doesn't really make sense to unit test because its just copying the same code twice. Any advice/help would be much appreciated, thanks! |
I think this example may help. Let's say you want to order 6 quantities of chicken. However, market 1 only has 4 supplies of chicken left. Therefore, the other 2 supplies should be covered by another market. |
So we're not "really" testing anything different than the first required test? |
Yep. I don't think we can "really" test it using the MockCook object because the cook's the one responsible for requesting an order for 2 markets. |
Okay great -- yeah I agree that all of the complexity for this case is in the CookAgent. Thanks |
How are we suppose to implement this? From my interpretation, it sounds as though the market itself splits the order into two while the restaurant sees it as one order.
In my restaurant, ChefAgent will create a new order for whatever was not fulfilled by the first order resulting in two orders to two markets.
For testing, do we the same... Send a partial sum of the order to one mockMarket and then the rest of the sum to a second mockMarket?
The text was updated successfully, but these errors were encountered: