How To Install Reciper Runner
Note
The following how-to is a work in progress - so it's AS-IS.
Download
GaxRecipeRunner.zip
Summary
This How-To detials out the steps to install and test Recipe Runner.
Content
- Objectives
- Overview
- Before you begin
- Step 1: Unzip and build Recipe Runner
- Step 2: AddIn Recipe Runner to Visual Studio 2005
- Step 3: Test simple recipe
- Step 4: Testing with Recipe Runner
- Other Links
Overview
Recipe Runner is testing tool to develop automated Visual Studio test of recipes created by GAX/GAT. These test can be managed and run by Visual Studio Test Manager. The tool works by creating executing the recipe and asserting if it performed correctly or incorrectly for postive and negative test case types.
Before you begin
You'll need to down load Recipe Runner from: <<add here>> Unzip this into a project area for this How-To.
Step 1: Unzip and build Recipe Runner
Unzip the projects and store them in work area. You'll have the following Solutions:
- GAXRecipeRunner - runs the recipe
- GAXTestIntegration - provides an interface to the recipe runner and example of a tested recipe
Perform the following operations:
- Open the GAXRecipeRunner solution
- Build the solution
- This creates the GAXRecipeRunner.dll
- This file will be reference by Visual Studio so store it in a locations that accessable.
Step 2: Adding the GAX Recipe Runner as a service to Visual Studio 2005
1st Part - Modify the addin file
- Open the GAXRecipeRunner.sln.
- Open the Addin directory within the solution
- Open the file 'GAXRecipeRunner.AddIn'
- Modify the following line to the location of file 'GAXRecipeRunner.dll'
- <Assembly>c:/the directory location for /GAXRecipeRunner.dll</Assembly>
- Save the changes
2nd Part - Add GAX Recipe Runner to Visual Studio
- Create the directory 'MyDocuments/Visual Studio 2005/Addins' if it doesn't exist.
- Copy the file 'GAXRecipeRunner.AddIn' to this location
3rd Part of this step
- Open a new instance of Visual Studio
- Under Tools, select Addin Manager
- Should see GAXRecipeRunner, select the start up Checkbox
- Close Visual Studio
Step 3: Verify that GAX Recipe Runner is installed Correctly
This step will verify that GAX Recipe Runner is installed correctly by running tests against a simple recipe.
- Open the GAXRecipeRunner.sln.
- Open the Test View window from the Menu:Test->Windows->Test View
- Select the test case "RunSimpleRecipe"
- Run the test - it should Pass
- Note: I have noted there an werid bug in this test - if passes most the time but fails occansionaly.
Step 4: Testing with GAX Recipe Runner
This steps walks through the following test code snippet found in 'RecipeRunnerFixture.cs'
1st part of this step is to prepare the recipe is to zip up the recipe solution, look through the GAXTestIntegration solution at the SimpleTestingPackageRecipeTests.
2nd part is to setup a the test itself. Look at the file RecipeRunnerFixture in the Simple Tests. A code snippet is below.
// TestClass
public class RecipeRunnerFixture : BaseFixture
{
TestInitialize()
public void TestInitialize()
{
// This sets the pointer to the Guidance Package
this.guidancePackageName = "SimpleTestingPackage";
// This sets the zip package and the solution containing the recipes to be tested
base.TestInitialize(Assembly.GetExecutingAssembly(),
"SimpleTestingPackageRecipeTests.SingleProjectSingleClassSingleProperty.zip",
"SingleProjectSingleClassSingleProperty.sln");
}
public override void TestCleanup()
{
base.TestCleanup();
}
// TestMethod
public void RunSimpleRecipe()
{
Project project = VSAutomationHelper.FindProjectByName(dte, "SingleProjectSingleClassSingleProperty");
// Set recipe arguments - look at the recipe for the inputs.
// Load up the hashtable is the sequence that the arguments are expected.
Hashtable args = new Hashtable();
args.Add("GeneratedClassName", "Foo");
//Execute recipe
recipeRunnerService.RunRecipe(this.guidancePackageName, "AddSimpleClass", args);
// This is where we check to see if the test pass or failed -
// expect to do alot of instrumentation
Assert.IsNotNull(recipeRunnerService.LastException, recipeRunnerService.LastException.Message);
Assert.AreEqual(3, project.ProjectItems.Count);
VSAutomationHelper.CompileProject(project);
//Clean up assets that were product of the recipe execution
VSAutomationHelper.DeleteProjectItem(project, "Foo.cs");
project.Save(project.FullName);
}