When unit testing ASP.NET MVC2 projects the issue of injecting HttpContext is quickly encountered. There seem to be many different ways/recommendations for mocking HttpContextBase to improve the testability of controllers and their actions. My investigations into that will probably be a separate blog post in the near future but for now, I want to cover something that had me stuck for longer than it probably should have. That is how to mock non-abstract/interfaced classes within . . .
The challenge set by problem 18 was By starting at the top of the triangle below and moving to adjacent numbers on the row below, the maximum total from top to bottom is 23. 3 7 4 2 4 6 8 5 9 3 That is, 3 + 7 + 4 + 9 = 23. A 15-row triangle was then supplied for which the program must determine the corresponding maximum value taking a similar path . . .
The challenge set by Problem 54 was to determine the number poker games payer 1 won given a text file detailing 1,000 hands dealt to 2 players. Given the logical nature of the rules, the solution was just a case of finding the best way to 1) implement the rules and 2) duplicate the rule hierarchy. I quickly re-factored my first attempt that attempted to place the ruled based logic inside of the PokerHand class . . .