Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Dependency Injection also allows fakes/mocks to be injected in unit tests.
Consider a function that processes orders.
We'd like to write a test that verifies that an order that has already been processed is not processed again. But any test written against this function will actually hit the transaction API and process the transaction because it is tightly coupled to the function.
Now let's refactor using Dependency Injection.
By having a higher application layer do the binding of the transaction API to the ProcessOrders function, we can now write a test using a fake transaction API. This fake transactionApi won't actually process a transaction. Instead, it will only record when ProcessTransaction is called. And our test can use this record to verify the desired rules.
This comment is hidden because it contains spoiler information about the solution
Wow. It's like I copied you exactly. This is the easiest to understand solution IMO. Linq FTW.
endingSymbol should have been startingSymbol but meh, whatever.