This project is read-only.

Tutorial for Unit Testing modules

Topics: Writing modules
Mar 2, 2011 at 10:45 AM

I'd like to see a tutorial for unit testing modules. Are there any recommendations for writing tests? For example, is it recommended to create tests for just the services?

Mar 2, 2011 at 7:09 PM

That is a great idea for a topic.

Jul 20, 2011 at 3:20 AM

Just wondering if there are any updates on it.

In my opinion the "codegen module" tool should generate test project by default.

Jul 20, 2011 at 5:01 AM

Sure! You can build that as a module, or contribute it. Actually, there is already a module on the gallery that adds more code generation commands. Maybe you could extend that?

Jul 20, 2011 at 5:07 AM

Before trying to create anything it's good to know the conventions, ways to structure the tests, reusing existing testing infrastructure (stubs and fakes) etc.
Only after that one can think of creating a module.

Let's just get to the tutorial of unit testing modules first. 

Jul 20, 2011 at 5:12 AM

Sure. Do you have an account on the wiki?

Jul 20, 2011 at 5:22 AM

Nope. Why?

Jul 20, 2011 at 5:26 AM

Because you'll need one if you want to write the topic.

Jul 20, 2011 at 5:31 AM

I don't think I know Orchard enough to write on the wiki. But I will probably blog about it when I'll get to that.

It would be good to hear recommendations from the Team members themselves.

Jul 20, 2011 at 6:02 AM

Fair enough. There isn't any specific guidance beyond being consistent with the existing test projects. The tricky part may be to put all this under source control in a way that works and that's not too contrived.