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

(10 points) One order, fulfilled by TWO markets, 2 bills paid in full. #104

Open
lshiffer opened this issue Nov 4, 2013 · 5 comments
Open

Comments

@lshiffer
Copy link

lshiffer commented Nov 4, 2013

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?

@maciesielka
Copy link

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!

@BachDinh1994
Copy link

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.
And you're right about independently asking the cashier for payment and copying the same code twice for testing lol.

@maciesielka
Copy link

So we're not "really" testing anything different than the first required test?

@BachDinh1994
Copy link

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.

@maciesielka
Copy link

Okay great -- yeah I agree that all of the complexity for this case is in the CookAgent. Thanks

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