vendredi 30 octobre 2015

How to unit-test a razor-view

When Scott Guthrie first blogged on Razor, he wrote

The new view engine implementation will support the ability to unit test views (without requiring a controller or web-server, and can be hosted in any unit test project – no special app-domain required).

However, I can find no other statement (or example) regarding razor-testability. There are pointers to using the CodelanguageServie or RazorGenerator or some self-made renderer - non of which I would call "by design".

Is it currently possible to unit test a razor view the simple way? (In an asp.net mvc-application, that is. I.e. NancyFx brings testability in it's nancy.testing-package.)

(And currently I don't care if views should be tested or not.)

I know there are loads of questions like this one, but most of them are rather old...

Aucun commentaire:

Enregistrer un commentaire