Tutorial for Unit Testing modules

Topics: Writing modules
Mar 2, 2011 at 9: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?

Coordinator
Mar 2, 2011 at 6:09 PM

That is a great idea for a topic.

Jul 20, 2011 at 2:20 AM

Just wondering if there are any updates on it.

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

Coordinator
Jul 20, 2011 at 4: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 4: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. 

Coordinator
Jul 20, 2011 at 4:12 AM

Sure. Do you have an account on the wiki?

Jul 20, 2011 at 4:22 AM

Nope. Why?

Coordinator
Jul 20, 2011 at 4:26 AM

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

Jul 20, 2011 at 4: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.

Coordinator
Jul 20, 2011 at 5: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.