OK – this was a really short session and it also marks the end of the first week of the project. Five hours a week – I’d love to work with this all the time…
I managed to get around the understanding of controllers. This article was a great help… BUT they have changed some stuff. So, in order to get hold of the actual model in a view you now (ASP.NET MVC RC 1) need to go:
[TestMethod]
public void indexViewModelIsAProductListWithOneElementsForTheTestUser()
{
var c = new ProductOwnerController();
var view = c.Index() as ViewResult;
var model = (List<Product>) view.ViewData.Model;
Assert.AreEqual(1, model.Count);
}
Small stuff – but quite tricky to find…
To summarize the first week, I must say I am quite happy:
- I am getting a hang of TDD. The test-first principle has taught me a lot about the model and keeps me from doing too much.
- Extreme OOP is harder than I thought. Much harder! I decided to keep that to the refactor stage of TDD (Red -> Green -> Refactor).
- DDD – I am not sure I am doing it right yet. Next week will include the Repository pattern – and I’ll need to understand that.
- ASP.NET MVC – haven’t touched much yet. I am in the modeling phase.
- I have been able to keep my max of 1 hour/day quite well. That means some days it has been zero, but that was my plan. I am free!!!
I’ll get back to you.