-
Notifications
You must be signed in to change notification settings - Fork 748
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add tests for reporting; fix include from custom xslt
- Loading branch information
1 parent
64e433d
commit d40dcfa
Showing
28 changed files
with
11,026 additions
and
42 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<configSections> | ||
<section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow"/> | ||
</configSections> | ||
|
||
<specFlow> | ||
<unitTestProvider name="NUnit"/> | ||
</specFlow> | ||
</configuration> |
14 changes: 14 additions & 0 deletions
14
Tests/ReportingTest.SampleProject/FeatureWithFailingScenarios.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Feature: Feature with failing scenarios | ||
In order to test reporting | ||
As a SpecFlow developer | ||
I want to have a feature that has failing scenarios | ||
|
||
@ignore | ||
Scenario: Ignored scenario | ||
Given I have a precondition that is successful | ||
|
||
Scenario: Scenario with pending steps | ||
Given I have a pending precondition | ||
|
||
Scenario: Scenario with failing steps | ||
Given I have a precondition that is failing |
15 changes: 15 additions & 0 deletions
15
Tests/ReportingTest.SampleProject/FeatureWithSuccessfulScenarios.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
Feature: Feature with successful scenarios | ||
In order to test reporting | ||
As a SpecFlow developer | ||
I want to have a feature that has successful scenarios | ||
|
||
Scenario: First successful scenario | ||
Given I have a precondition that is successful | ||
When I do something that works | ||
Then I have a postcondition that is successful | ||
|
||
Scenario: Second successful scenario | ||
Given I have a precondition that is successful | ||
And I have a precondition that is successful | ||
When I do something that works | ||
Then I have a postcondition that is successful |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
pushd %~dp0\.. | ||
|
||
..\..\lib\nunit\nunit-console.exe bin\Debug\ReportingTest.SampleProject.dll /labels /xml=NUnitResult\TestResult.xml /out:NUnitResult\TestResult.txt /err:NUnitResult\TestResult.err | ||
|
||
popd |
36 changes: 36 additions & 0 deletions
36
Tests/ReportingTest.SampleProject/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("ReportingTest.SampleProject")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("Microsoft")] | ||
[assembly: AssemblyProduct("ReportingTest.SampleProject")] | ||
[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("72c7aff1-9d5f-4975-9396-294c8d4ced33")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
82 changes: 82 additions & 0 deletions
82
Tests/ReportingTest.SampleProject/ReportingTest.SampleProject.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>9.0.30729</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{E5C299D5-E7CC-4477-9A0B-4797B74BC88B}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>ReportingTest.SampleProject</RootNamespace> | ||
<AssemblyName>ReportingTest.SampleProject</AssemblyName> | ||
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="nunit.framework, Version=2.5.1.9189, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\..\lib\nunit\nunit.framework.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core"> | ||
<RequiredTargetFramework>3.5</RequiredTargetFramework> | ||
</Reference> | ||
<Reference Include="System.Xml.Linq"> | ||
<RequiredTargetFramework>3.5</RequiredTargetFramework> | ||
</Reference> | ||
<Reference Include="System.Data.DataSetExtensions"> | ||
<RequiredTargetFramework>3.5</RequiredTargetFramework> | ||
</Reference> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="StepDefinitions.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\Runtime\TechTalk.SpecFlow.csproj"> | ||
<Project>{413EE28C-4F89-4C6F-BA1E-2CDEE4CD43B4}</Project> | ||
<Name>TechTalk.SpecFlow</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="App.config" /> | ||
<None Include="FeatureWithFailingScenarios.feature"> | ||
</None> | ||
<None Include="FeatureWithSuccessfulScenarios.feature"> | ||
</None> | ||
<None Include="NUnitResult\generate.cmd" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="NUnitResult\TestResult.txt" /> | ||
<Content Include="NUnitResult\TestResult.xml" /> | ||
<Content Include="readme.txt" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using TechTalk.SpecFlow; | ||
using NUnit.Framework; | ||
|
||
namespace ReportingTest.SampleProject | ||
{ | ||
[Binding] | ||
public class StepDefinitions | ||
{ | ||
[Given(@"I have a precondition that is (.*)")] | ||
[When(@"I do something that (.*)")] | ||
[Then(@"I have a postcondition that is (.*)")] | ||
public void GivenIHaveAPreconditionThatIs(string result) | ||
{ | ||
switch(result.ToLower()) | ||
{ | ||
case "successful": | ||
case "works": | ||
return; | ||
case "failing": | ||
Assert.Fail("simulated failure"); | ||
break; | ||
case "pending": | ||
ScenarioContext.Current.Pending(); | ||
break; | ||
default: | ||
Assert.Fail("unknown result"); | ||
break; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
This project is not a test project for SpecFlow, but a sample specflow test | ||
project that is used for testing the reporting. | ||
|
||
The unit tests generated by SpecFlow are disabled, to avoid execution and | ||
fake error reports for SpecFlow. | ||
|
||
Enable the sample tests: | ||
- set the "Custom Tool" property of the feature file nodes to "SpecFlowSingleFileGenerator" | ||
|
||
Disable the sample tests: | ||
- set the "Custom Tool" property of the feature file nodes to empty |
Oops, something went wrong.