ABSF With Support For Block & Library Templates For NUnit

Topics: Building and extending application blocks
Feb 3, 2007 at 5:17 PM
I am really excited about this new release of EntLib and welcome the approach you've taken on with software factories! I understand that the P&P team focus on testing with VSTS, but for some of us mortals out there, VSTS is simply out of reach due to prohibitive costs and infrastructure. I just tried creating my own playpen application block using the ABSF and failed exactly for the aforementioned reason. I have tried updating amy references to VSTS assemblies, but somewhere and somehow the solution creation fails unexpectedly each and every time when the test projects are added. Though I've followed the software factory initiatives by Microsoft, I am a newcommer to the GAT/GAX and it isquite a chunk to digest and understand at first glance which is why I am finding it hard to remove dependencies on VSTS.

Do you have any plans for releasing a patch before the next CTP or since 'tis February already, any word of when the Feb. CTP may be due? If not, do you have any advice where I may need to look for further resources/dependencies linkied to VSTS tests so I can remove/replace these for NUnit?

Like I said before, I understand that VSTS is your primary development environment and target, but as the EntLib projects are in the "public domain" to some extent, it would be great if we could at least have VSTS and NUnit version released simultaneously?

Any help would be much appreciated as I'm really itching to have a go with the Application Block Software Factory. Keep up the fantastic work and keep us posted on what the new Object Policy Application Block will entail. Thanks!

Feb 4, 2007 at 11:32 AM
Or to have an option for enabling/disabling unit testing, in initial configuration wizards.
This will allow to add unit testing options later on projects.
Feb 4, 2007 at 5:20 PM
I recommend you add this to the issue tracker so it does not get lost in here.

I am glad you brought this up because I have made a couple of blocks and provider libraries but would have never caught this as I use team system.

It is actually quite easy to "fix" the problem if you want to take a stab at using the Guidance Automation Toolkit. These are the lines that create the unit tests that can be found in the BlockSolutionCSharp.vstemplate file:

<SolutionFolder Name="Unit Tests">
<ProjectTemplateLink ProjectName="$ProjectName$.Tests">Projects\BlockCS.Tests\Block.Tests.vstemplate</ProjectTemplateLink>
<ProjectTemplateLink ProjectName="$ProjectName$.Configuration.Design.Tests">Projects\BlockCS.Design.Tests\Block.Design.Tests.vstemplate</ProjectTemplateLink>

There is a separate one for VB and also separate ones for Provider Libraries. I believe ( but haven't tried it )one would just need to remove them and redeploy the guidance package.

In the long run, however, I think they should just provide a checkbox that gives you the option of having unit tests created. An option to choose NUnit or other would be a nice to have, too.

Again, I would add this to the Issue Tracker so it makes the February Drop. I think that will be the last drop before release and you want it in there as soon as possible.




David Hayden
Microsoft MVP C#
Feb 4, 2007 at 6:57 PM
Edited Feb 4, 2007 at 7:02 PM
Thanks for quick answer, but this is not working. In fact, is same error what I receive having "Unit Tests" folders defined, after an "This project type is not supported by this installation." error..

On my configuration, I have following error:

Microsoft.Practices.RecipeFramework.RecipeExecutionException: An exception occurred during the binding of reference or execution of recipe CreateApplicationBlock. Error was: The following arguments are required and don't have values: RuntimeTestProject, DesignTimeProject, DesignTimeTestProject, DesignTimeResources. Can't continue execution..

You can remove the reference to this recipe through the Guidance Package Manager.
at Microsoft.Practices.RecipeFramework.Recipe.ThrowIfRequiredArgumentsAreNull(IDictionaryService arguments)
at Microsoft.Practices.RecipeFramework.Recipe.Execute(Boolean allowSuspend)
at Microsoft.Practices.RecipeFramework.GuidancePackage.Execute(String recipe, IAssetReference reference, IDictionary arguments)
at Microsoft.Practices.RecipeFramework.GuidancePackage.ExecuteFromTemplate(String recipe, IDictionary arguments)
at Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate.ExecuteRecipe(Boolean executeActions)
at Microsoft.Practices.RecipeFramework.VisualStudio.Templates.UnfoldTemplate.RunFinished()

Feb 4, 2007 at 9:07 PM
Thanks everyone. At a minimum we are planning on updating the guidance packages so it will not fail when VSTS is not installed (i.e. it won't attempt to add the test projects). At this stage I don't think we'll be able to explicitly support NUnit tests in the ABSF, but at least you should be able to use the factory and create your own tests.