Unit testing

Unit testing

Old forum URL: forums.lhotka.net/forums/t/6095.aspx


rfcdejong posted on Wednesday, January 07, 2009

Is there someone who has written an unit test project for the pttracker project?

Or else is it possible to write one to deploy with the sample project?

rfcdejong replied on Saturday, January 10, 2009

Noone?

RockfordLhotka replied on Saturday, January 10, 2009

It is absolutely possible. It may not be practical, for me at least, because it would add yet another whole set of code for me to maintain twice (VB and C#). For a production system I think having unit tests is a great idea - critical even. But they aren't free, and it is already a lot of work to keep the app running and in sync between both languages.

Now if I created unit tests in C# only, for both the VB and C# ProjectTracker.Library assemblies - THAT would be useful in a practical sense. But that would be counter to the purpose of ProjectTracker, which is to act as a sample. So it is absolutely necessary to do the work in both languages.

In short, it might happen, but it isn't real high on my priority list, because all it will do is slow down mods to everything.

William replied on Sunday, January 11, 2009

Rocky,

In my opinion, I think having unit test code in the sample helps to demonstrate the recommended approach to unit test business objects built with CSLA framework. Actually, this is one of the areas I am struggling with the framework.

Besides, to my understanding, you plan to concentrate on C# for the framework going forward and the VB version is left as community effort.

rfcdejong replied on Sunday, January 11, 2009

drop VB :)

Just kidding ofcourse, i do not want the VB community on my neck ;)

triplea replied on Sunday, January 11, 2009

I think the problem is that if a sample unit test project is added there might be too much criticism... There seem to be a lot of ideas floating around about how to unit test your BOs and people seem to have different views (specially when it comes to DB access). Also where do you stop can be an issue since we all seem to have our views on how much code unit tests should cover... Anyway, I am not saying it would be wrong but I can understand why this is not in place yet...

RockfordLhotka replied on Sunday, January 11, 2009

That’s perhaps a concern, but realistically I find a continual stream of people who do/don’t like what I’m doing anyway :)

 

Rocky

 

 

From: triplea [mailto:cslanet@lhotka.net]
Sent: Sunday, January 11, 2009 2:17 PM
To: rocky@lhotka.net
Subject: Re: [CSLA .NET] Unit testing

 

I think the problem is that if a sample unit test project is added there might be too much criticism... There seem to be a lot of ideas floating around about how to unit test your BOs and people seem to have different views (specially when it comes to DB access). Also where do you stop can be an issue since we all seem to have our views on how much code unit tests should cover... Anyway, I am not saying it would be wrong but I can understand why this is not in place yet...

rfcdejong replied on Friday, January 16, 2009

Maybe just a codeplex drop? Not really 'supported' by someone from CSLA :)

Jonathan Parker replied on Sunday, January 18, 2009

For now there is a upcoming post at Newmin's .NET about unit testing BOs.

Here's where he mentions the upcoming article:

Quote:
Where is CSLA code? Well, customerFactory is an instance of ReadOnlyListFactory class. RetreiveAll() returns CustomerList instance which is ReadOnlyBase implemenation. But why not use CustomerList.RetreiveAll() - factory method? Instead of using Factory Method design patern, we are using Abstract Factory, moving Create(), and Fetch() outside of our Csla BOs, for the purpose of easier Unit Testing. I will explain the details of this in one of the future posts that has to explain the whole process of testing all of the app layers in Csla - which will probably be the best part of this demo.

http://www.nermins.net/default.aspx

RockfordLhotka replied on Sunday, January 11, 2009

The framework is C# going forward. The ProjectTracker app is C# and VB.

 

I don’t disagree with your request – and I’m not saying no. I’m just saying “not now” :)

 

Rocky

 

Copyright (c) Marimer LLC