views:

37

answers:

0

Is thera any good way to write Unit Tests for controllers and EF4 without POCOs?

I have few repositories, controllers with injected repos and i'd like to write some unit tests (i know, tests should be written before, but noone's done it).

To test controller i have to mock HttpContext etc. and inject repo with Mocked ObjectContext generated by EF. As i read it would be easy if i generate POCO classes, but i can't because of db provider (oracle provider).

I skipped tests for repositories, bacause of those problems (i know, they should be tested) but now i don't know how to test controllers without access to db if i can't mock EF's objects.