Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Acceptance Tests with SpecFlow
- Loading branch information
1 parent
01ed9bb
commit c4deb0c
Showing
6 changed files
with
226 additions
and
0 deletions.
There are no files selected for viewing
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,21 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<configSections> | ||
<section name="specFlow" type="TechTalk.SpecFlow.Configuration.ConfigurationSectionHandler, TechTalk.SpecFlow"/> | ||
</configSections> | ||
|
||
<!-- the following configuration represent the defaults --> | ||
<specFlow> | ||
<language feature="en-US" /> | ||
|
||
<unitTestProvider name="NUnit" /> | ||
|
||
<runtime detectAmbiguousMatches="true" | ||
stopAtFirstError="false" | ||
missingOrPendingStepsOutcome="Inconclusive" /> | ||
|
||
<trace traceSuccessfulSteps="true" | ||
traceTimings="false" | ||
minTracedDuration="0:0:0.1" /> | ||
</specFlow> | ||
</configuration> |
76 changes: 76 additions & 0 deletions
76
MouseAlive.AcceptanceTests/MouseAlive.AcceptanceTests.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,76 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">x86</Platform> | ||
<ProductVersion>8.0.30703</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{AF3E4F64-5C96-4055-B4A6-3ED747A0F762}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>MouseAlive.AcceptanceTests</RootNamespace> | ||
<AssemblyName>MouseAlive.AcceptanceTests</AssemblyName> | ||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
<TargetFrameworkProfile>Client</TargetFrameworkProfile> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' "> | ||
<PlatformTarget>x86</PlatformTarget> | ||
<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|x86' "> | ||
<PlatformTarget>x86</PlatformTarget> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<StartupObject /> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<None Include="App.config" /> | ||
<None Include="MouseUtilities.feature"> | ||
<Generator>SpecFlowSingleFileGenerator</Generator> | ||
<LastGenOutput>MouseUtilities.feature.cs</LastGenOutput> | ||
</None> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="MouseUtilities.feature.cs"> | ||
<AutoGen>True</AutoGen> | ||
<DesignTime>True</DesignTime> | ||
<DependentUpon>MouseUtilities.feature</DependentUpon> | ||
</Compile> | ||
<Compile Include="MouseUtilitiesSteps.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Reference Include="nunit.framework, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL" /> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Drawing" /> | ||
<Reference Include="TechTalk.SpecFlow"> | ||
<HintPath>C:\Program Files (x86)\TechTalk\SpecFlow\TechTalk.SpecFlow.dll</HintPath> | ||
</Reference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\MouseAlive\MouseAlive.csproj"> | ||
<Project>{284DE1A9-7189-4B58-8573-81681A982F9F}</Project> | ||
<Name>MouseAlive</Name> | ||
</ProjectReference> | ||
</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,9 @@ | ||
Feature: Mouse Utilities | ||
In order to keep the screen saver from activating | ||
As a remote support agent | ||
I want to have the mouse moved for me automatically | ||
|
||
Scenario: Move Mouse | ||
Given I am working on a machine with MouseAlive | ||
When a certain amount of time has elapsed | ||
Then the mouse should move automatically |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using TechTalk.SpecFlow; | ||
using NUnit.Framework; | ||
using System.Drawing; | ||
|
||
namespace MouseAlive.AcceptanceTests { | ||
[Binding] | ||
public class MouseUtilitiesSteps { | ||
|
||
private Point point; | ||
|
||
[Given("I am working on a machine with MouseAlive")] | ||
public void GivenIAmWorkingOnAMachineWithMouseAlive() { | ||
point = MouseUtilities.GetMousePosition(); | ||
} | ||
|
||
[When("a certain amount of time has elapsed")] | ||
public void WhenIAmAwayFromMyDesk() { | ||
var oldPoint = point; | ||
MouseUtilities.MoveMouse(); | ||
|
||
} | ||
|
||
[Then("the mouse should move automatically")] | ||
public void ThenTheMouseShouldMoveAutomaticallyOverATimeInterval() { | ||
var newPoint = MouseUtilities.GetMousePosition(); | ||
Assert.AreNotEqual(point, newPoint); | ||
} | ||
} | ||
} |
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