Unit Testing WPF Prism based application

Topics: Prism v4 - WPF 4
Aug 5, 2010 at 1:51 PM

Hi All,

I am about to start creating unit test project for my WPF application which is created using Prism framework with MVVM design pattern.

But the problem is that I am not able to find any quick start or tutorial n this.

Can any one in the community help me out, how can I start working on unit test project for WPF Prism based application?

I have seen the Test projects created along with the Prism Quick start, but they dont give much information for new starters.

Please help me out on this.

 

 

Thanks and Regards,

Harry

Aug 5, 2010 at 8:16 PM

Hi Harry,

Regarding testing, Prism is focused on providing testable components and it is built using a TDD approach. Nevertheless, the guidance of Prism is not focused on how its components are tested. This is why, you couldn’t find any particular Quickstart that provide this kind of information.

However, if you open some of the Quickstart solutions in Prism v4 CTP or Prism v2.2, you could be able to see an associated test project, as you mentioned.

That said, for more information about unit testing, you could see the following links:

Additionally, as this question is not strictly related to Prism if you have more question about it, you could also use the  Visual Studio Unit Testing forum.

Please let me know if this helps.

Fernando Antivero
http://blogs.southworks.net/fantivero

Aug 6, 2010 at 6:48 AM

Hi Fernando,

Thanks for your reply. I will go through the links you provided.

While analyzing the unit test project provided along with Prism setup, I came across "Microsoft.Practices.Composite.TestSupport" namespace,

which is used for creating Mock objects for container, region manager etc... is there any documentation available for that.

 

Regards,

Harry

 

Aug 6, 2010 at 6:33 PM

Hi Harry,

There is no documentation available about this assembly. This assembly was included in Prism v2.2, and it provides a mock class of the Unity container for the purpose of facilitates the unit testing. In other words, it is used (and could be reused) for testing functionality that makes of use of the container in run-time.

As this could be something valuable to include in future versions, I have copied this discussion to a work item. You can find it here.

Thanks for your feedback.

Please let me know if this helps.

Fernando Antivero
http://blogs.southworks.net/fantivero

Aug 9, 2010 at 6:27 AM

Hi Fernando,

Thanks for your co-operation.

Regards,

Harry.