diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..90995cb
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,125 @@
+push.bat
+TestResult.xml
+obj
+bin
+deploy
+deploy/*
+.idea/*
+src/CommonAssemblyInfo.cs
+_ReSharper.*
+*.csproj.user
+*.resharper.user
+*.ReSharper.user
+*.suo
+*.cache
+~$*
+*.orig
+.sass-cache
+/Pathways.5.1.TeamCity.user
+/src/Pathways/Output
+combined_*.js
+
+Rakefile.cg
+.idea
+/src/Pathways/Bin/AjaxMin.dll
+/src/Pathways/Bin/AsyncCtpLibrary.dll
+/src/Pathways/Bin/Castle.Core.dll
+/src/Pathways/Bin/Castle.Core.pdb
+/src/Pathways/Bin/Castle.Core.xml
+/src/Pathways/Bin/Castle.Facilities.Logging.dll
+/src/Pathways/Bin/Castle.Facilities.Logging.pdb
+/src/Pathways/Bin/Castle.Facilities.Logging.xml
+/src/Pathways/Bin/Castle.Services.Logging.Log4netIntegration.dll
+/src/Pathways/Bin/Castle.Services.Logging.Log4netIntegration.pdb
+/src/Pathways/Bin/Castle.Windsor.Lifestyles.dll
+/src/Pathways/Bin/Castle.Windsor.Lifestyles.pdb
+/src/Pathways/Bin/Castle.Windsor.dll
+/src/Pathways/Bin/Castle.Windsor.pdb
+/src/Pathways/Bin/Castle.Windsor.xml
+/src/Pathways/Bin/EcmaScript.NET.modified.dll
+/src/Pathways/Bin/Elmah.dll
+/src/Pathways/Bin/Elmah.pdb
+/src/Pathways/Bin/Elmah.xml
+/src/Pathways/Bin/Esent.Interop.dll
+/src/Pathways/Bin/Esent.Interop.pdb
+/src/Pathways/Bin/Esent.Interop.xml
+/src/Pathways/Bin/Exceptioneer.WebClient.dll
+/src/Pathways/Bin/Fasterflect.dll
+/src/Pathways/Bin/GleamTech.FileUltimate.dll
+/src/Pathways/Bin/GrammarParser.dll
+/src/Pathways/Bin/GrammarParser.pdb
+/src/Pathways/Bin/ICSharpCode.NRefactory.dll
+/src/Pathways/Bin/Lucene.Net.dll
+/src/Pathways/Bin/Lucene.Net.pdb
+/src/Pathways/Bin/Lucene.Net.xml
+/src/Pathways/Bin/Machine.Specifications.dll
+/src/Pathways/Bin/Machine.Specifications.pdb
+/src/Pathways/Bin/Mono.Posix.dll
+/src/Pathways/Bin/Newtonsoft.Json.dll
+/src/Pathways/Bin/Newtonsoft.Json.pdb
+/src/Pathways/Bin/Newtonsoft.Json.xml
+/src/Pathways/Bin/OpenFileSystem.dll
+/src/Pathways/Bin/OpenFileSystem.pdb
+/src/Pathways/Bin/Pathways.dll
+/src/Pathways/Bin/Pathways.pdb
+/src/Pathways/Bin/Performance.dll
+/src/Pathways/Bin/Performance.pdb
+/src/Pathways/Bin/Ploeh.AutoFixture.dll
+/src/Pathways/Bin/Ploeh.AutoFixture.xml
+/src/Pathways/Bin/Raven.Abstractions.dll
+/src/Pathways/Bin/Raven.Abstractions.pdb
+/src/Pathways/Bin/Raven.Client.Embedded.dll
+/src/Pathways/Bin/Raven.Client.Embedded.pdb
+/src/Pathways/Bin/Raven.Client.Embedded.xml
+/src/Pathways/Bin/Raven.Client.Lightweight.dll
+/src/Pathways/Bin/Raven.Client.Lightweight.pdb
+/src/Pathways/Bin/Raven.Client.Lightweight.xml
+/src/Pathways/Bin/Raven.Database.dll
+/src/Pathways/Bin/Raven.Database.pdb
+/src/Pathways/Bin/Raven.Http.dll
+/src/Pathways/Bin/Raven.Http.pdb
+/src/Pathways/Bin/Raven.Munin.dll
+/src/Pathways/Bin/Raven.Munin.pdb
+/src/Pathways/Bin/Raven.Storage.Managed.dll
+/src/Pathways/Bin/Raven.Storage.Managed.pdb
+/src/Pathways/Bin/Snooze.dll
+/src/Pathways/Bin/Snooze.pdb
+/src/Pathways/Bin/Spark.Web.Mvc.dll
+/src/Pathways/Bin/Spark.Web.Mvc.pdb
+/src/Pathways/Bin/Spark.dll
+/src/Pathways/Bin/Spark.pdb
+/src/Pathways/Bin/Spatial.Net.dll
+/src/Pathways/Bin/SpellChecker.Net.dll
+/src/Pathways/Bin/SpellChecker.Net.xml
+/src/Pathways/Bin/SquishIt.Framework.dll
+/src/Pathways/Bin/SquishIt.Framework.pdb
+/src/Pathways/Bin/System.Data.SQLite.dll
+/src/Pathways/Bin/Tjoc.Web.Validator.dll
+/src/Pathways/Bin/Tjoc.Web.Validator.pdb
+/src/Pathways/Bin/VistaDB.NET20.dll
+/src/Pathways/Bin/Yahoo.Yui.Compressor.dll
+/src/Pathways/Bin/dotless.Core.dll
+/src/Pathways/Bin/dotless.Core.pdb
+/src/Pathways/Bin/log4net.dll
+/src/Pathways/Bin/log4net.xml
+/src/Pathways/Bin/mxgraph.dll
+/src/Pathways/Bin/mxgraph.pdb
+/src/Pathways/Bin/nVentive.Umbrella.dll
+/src/Pathways/Bin/nVentive.Umbrella.pdb
+/src/Pathways/Bin/InstallUtil.InstallLog
+/src/Pathways/Bin/performance.InstallLog
+/src/Pathways/Bin/performance.InstallState
+/src/Pathways/Bin/Logging.dll
+/src/Pathways/Bin/Logging.pdb
+/src/Pathways/Bin/MarkupProcessor.dll
+/src/Pathways/Bin/MarkupProcessor.pdb
+/src/Pathways/Bin/MvcContrib.TestHelper.dll
+/src/Pathways/Bin/MvcContrib.TestHelper.pdb
+/src/Pathways/Bin/MvcContrib.TestHelper.xml
+/src/Pathways/Bin/MvcContrib.dll
+/src/Pathways/Bin/MvcContrib.pdb
+/src/Pathways/Bin/MvcContrib.xml
+/src/Pathways/Bin/Rhino.Mocks.dll
+/src/Pathways/Bin/Rhino.Mocks.xml
+/src/Pathways/Bin/Castle.MonoRail.Views.Spark.dll
+/src/Pathways/Bin/Castle.MonoRail.Views.Spark.pdb
\ No newline at end of file
diff --git a/Chess.5.9.TeamCity.user b/Chess.5.9.TeamCity.user
new file mode 100644
index 0000000..9ecb8f5
--- /dev/null
+++ b/Chess.5.9.TeamCity.user
@@ -0,0 +1,11 @@
+
+
+
+ -TeamCity;
+
+
+
+ False
+
+
+
\ No newline at end of file
diff --git a/Chess.sln b/Chess.sln
new file mode 100644
index 0000000..9baf884
--- /dev/null
+++ b/Chess.sln
@@ -0,0 +1,26 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Chess", "Chess\Chess.csproj", "{B65526E3-C8D9-4561-8824-63C19F75B034}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spec", "Spec\Spec.csproj", "{741B926B-D9E8-46B7-8394-046120DF7583}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B65526E3-C8D9-4561-8824-63C19F75B034}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B65526E3-C8D9-4561-8824-63C19F75B034}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B65526E3-C8D9-4561-8824-63C19F75B034}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B65526E3-C8D9-4561-8824-63C19F75B034}.Release|Any CPU.Build.0 = Release|Any CPU
+ {741B926B-D9E8-46B7-8394-046120DF7583}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {741B926B-D9E8-46B7-8394-046120DF7583}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {741B926B-D9E8-46B7-8394-046120DF7583}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {741B926B-D9E8-46B7-8394-046120DF7583}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Chess/Chess.csproj b/Chess/Chess.csproj
new file mode 100644
index 0000000..0c7b704
--- /dev/null
+++ b/Chess/Chess.csproj
@@ -0,0 +1,107 @@
+
+
+
+ Debug
+ AnyCPU
+ 8.0.30703
+ 2.0
+ {B65526E3-C8D9-4561-8824-63C19F75B034}
+ Library
+ Properties
+ Chess
+ Chess
+ v4.0
+ 512
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\..\lib\nunit.framework.dll
+
+
+
+
+
+
+
+
+
+ ..\..\..\Program Files (x86)\TechTalk\SpecFlow\TechTalk.SpecFlow.dll
+
+
+ ..\..\..\Program Files (x86)\TechTalk\SpecFlow\TechTalk.SpecFlow.Parser.dll
+
+
+
+
+
+
+ True
+ True
+ ChessBoard.feature
+
+
+
+ True
+ True
+ MovingTheKnight.feature
+
+
+
+ True
+ True
+ PawnMovesLegally.feature
+
+
+
+ True
+ True
+ TakingAPiece.feature
+
+
+
+
+
+
+
+ SpecFlowSingleFileGenerator
+ ChessBoard1.feature.cs
+
+
+ SpecFlowSingleFileGenerator
+ MovingTheKnight1.feature.cs
+
+
+ SpecFlowSingleFileGenerator
+ PawnMovesLegally1.feature.cs
+
+
+ SpecFlowSingleFileGenerator
+ TakingAPiece1.feature.cs
+
+
+
+
+
\ No newline at end of file
diff --git a/Chess/Class1.cs b/Chess/Class1.cs
new file mode 100644
index 0000000..859125f
--- /dev/null
+++ b/Chess/Class1.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Chess
+{
+ public class Class1
+ {
+ }
+}
diff --git a/Chess/Features/ChessBoard.feature b/Chess/Features/ChessBoard.feature
new file mode 100644
index 0000000..18eaa81
--- /dev/null
+++ b/Chess/Features/ChessBoard.feature
@@ -0,0 +1,17 @@
+Feature: Boundaries of the board.
+In order to obey the rules of Chess
+As a player
+I want to be prevented from entering moves outside the boundary of the board.
+
+Scenario: Pawn at top.
+Given I have a White Pawn at A8
+And I have a Black Knight at A1
+When I move the Pawn to A9
+Then I should be warned of an illegal move message
+
+Scenario: Knight heads off board
+Given I have a Black Knight at G8
+And I have a White Pawn at A1
+And I move the Pawn to A2
+When I move the Knight to I7
+Then I should be warned of an illegal move message
diff --git a/Chess/Features/ChessBoard.feature.cs b/Chess/Features/ChessBoard.feature.cs
new file mode 100644
index 0000000..e341f7c
--- /dev/null
+++ b/Chess/Features/ChessBoard.feature.cs
@@ -0,0 +1,97 @@
+// ------------------------------------------------------------------------------
+//
+// This code was generated by SpecFlow (http://www.specflow.org/).
+// SpecFlow Version:1.4.0.0
+// Runtime Version:4.0.30319.1
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+// ------------------------------------------------------------------------------
+#region Designer generated code
+namespace ChessBoard.Features
+{
+ using TechTalk.SpecFlow;
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.4.0.0")]
+ [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [NUnit.Framework.TestFixtureAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Boundaries of the board.")]
+ public partial class BoundariesOfTheBoard_Feature
+ {
+
+ private static TechTalk.SpecFlow.ITestRunner testRunner;
+
+#line 1 "ChessBoard.feature"
+#line hidden
+
+ [NUnit.Framework.TestFixtureSetUpAttribute()]
+ public virtual void FeatureSetup()
+ {
+ testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Boundaries of the board.", "In order to obey the rules of Chess\r\nAs a player\r\nI want to be prevented from ent" +
+ "ering moves outside the boundary of the board.", GenerationTargetLanguage.CSharp, ((string[])(null)));
+ testRunner.OnFeatureStart(featureInfo);
+ }
+
+ [NUnit.Framework.TestFixtureTearDownAttribute()]
+ public virtual void FeatureTearDown()
+ {
+ testRunner.OnFeatureEnd();
+ testRunner = null;
+ }
+
+ public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+ {
+ testRunner.OnScenarioStart(scenarioInfo);
+ }
+
+ [NUnit.Framework.TearDownAttribute()]
+ public virtual void ScenarioTearDown()
+ {
+ testRunner.OnScenarioEnd();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn at top.")]
+ public virtual void PawnAtTop_()
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Pawn at top.", ((string[])(null)));
+#line 6
+this.ScenarioSetup(scenarioInfo);
+#line 7
+testRunner.Given("I have a White Pawn at A8");
+#line 8
+testRunner.And("I have a Black Knight at A1");
+#line 9
+testRunner.When("I move the Pawn to A9");
+#line 10
+testRunner.Then("I should be warned of an illegal move message");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Knight heads off board")]
+ public virtual void KnightHeadsOffBoard()
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Knight heads off board", ((string[])(null)));
+#line 12
+this.ScenarioSetup(scenarioInfo);
+#line 13
+testRunner.Given("I have a Black Knight at G8");
+#line 14
+testRunner.And("I have a White Pawn at A1");
+#line 15
+testRunner.And("I move the Pawn to A2");
+#line 16
+testRunner.When("I move the Knight to I7");
+#line 17
+testRunner.Then("I should be warned of an illegal move message");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+ }
+}
+#endregion
diff --git a/Chess/Features/ChessBoard1.feature.cs b/Chess/Features/ChessBoard1.feature.cs
new file mode 100644
index 0000000..d6022ee
--- /dev/null
+++ b/Chess/Features/ChessBoard1.feature.cs
@@ -0,0 +1,97 @@
+// ------------------------------------------------------------------------------
+//
+// This code was generated by SpecFlow (http://www.specflow.org/).
+// SpecFlow Version:1.5.0.0
+// Runtime Version:4.0.30319.1
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+// ------------------------------------------------------------------------------
+#region Designer generated code
+namespace Chess.Features
+{
+ using TechTalk.SpecFlow;
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.5.0.0")]
+ [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [NUnit.Framework.TestFixtureAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Boundaries of the board.")]
+ public partial class BoundariesOfTheBoard_Feature
+ {
+
+ private static TechTalk.SpecFlow.ITestRunner testRunner;
+
+#line 1 "ChessBoard.feature"
+#line hidden
+
+ [NUnit.Framework.TestFixtureSetUpAttribute()]
+ public virtual void FeatureSetup()
+ {
+ testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Boundaries of the board.", "In order to obey the rules of Chess\r\nAs a player\r\nI want to be prevented from ent" +
+ "ering moves outside the boundary of the board.", GenerationTargetLanguage.CSharp, ((string[])(null)));
+ testRunner.OnFeatureStart(featureInfo);
+ }
+
+ [NUnit.Framework.TestFixtureTearDownAttribute()]
+ public virtual void FeatureTearDown()
+ {
+ testRunner.OnFeatureEnd();
+ testRunner = null;
+ }
+
+ public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+ {
+ testRunner.OnScenarioStart(scenarioInfo);
+ }
+
+ [NUnit.Framework.TearDownAttribute()]
+ public virtual void ScenarioTearDown()
+ {
+ testRunner.OnScenarioEnd();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn at top.")]
+ public virtual void PawnAtTop_()
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Pawn at top.", ((string[])(null)));
+#line 6
+this.ScenarioSetup(scenarioInfo);
+#line 7
+testRunner.Given("I have a White Pawn at A8");
+#line 8
+testRunner.And("I have a Black Knight at A1");
+#line 9
+testRunner.When("I move the Pawn to A9");
+#line 10
+testRunner.Then("I should be warned of an illegal move message");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Knight heads off board")]
+ public virtual void KnightHeadsOffBoard()
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Knight heads off board", ((string[])(null)));
+#line 12
+this.ScenarioSetup(scenarioInfo);
+#line 13
+testRunner.Given("I have a Black Knight at G8");
+#line 14
+testRunner.And("I have a White Pawn at A1");
+#line 15
+testRunner.And("I move the Pawn to A2");
+#line 16
+testRunner.When("I move the Knight to I7");
+#line 17
+testRunner.Then("I should be warned of an illegal move message");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+ }
+}
+#endregion
diff --git a/Chess/Features/MovingTheKnight.feature b/Chess/Features/MovingTheKnight.feature
new file mode 100644
index 0000000..b564cb6
--- /dev/null
+++ b/Chess/Features/MovingTheKnight.feature
@@ -0,0 +1,87 @@
+Feature: Moving the Knight.
+In order to play chess
+As a Player
+I want to move the Knight legally.
+
+Scenario: Moving the knight legally
+Given I have a Black Knight at D4
+And I have a White Pawn at A1
+And I move the Pawn to A2
+When I move the Knight to F5
+Then I should be shown "Knight to F5"
+
+Scenario Outline: Illegal Move
+Given I have a Black Knight at D4
+And the valid moves are
+|move|
+|B3|
+|B5|
+|C2|
+|C6|
+|E2|
+|E6|
+|F3|
+|F5|
+And I have a White Pawn at A1
+And I move the Pawn to A2
+When I move the Knight to
+Then I should be shown "Illegal Move"
+
+Scenarios: Positions
+|Position|
+|A1|
+|A2|
+|A3|
+|A4|
+|A5|
+|A6|
+|A7|
+|A8|
+|B1|
+|B2|
+|B4|
+|B6|
+|B7|
+|B8|
+|C1|
+|C3|
+|C4|
+|C5|
+|C7|
+|C8|
+|D1|
+|D2|
+|D3|
+|D4|
+|D5|
+|D6|
+|D7|
+|D8|
+|E1|
+|E3|
+|E4|
+|E5|
+|E7|
+|E8|
+|F1|
+|F2|
+|F4|
+|F6|
+|F7|
+|F8|
+|G1|
+|G2|
+|G3|
+|G4|
+|G5|
+|G6|
+|G7|
+|G8|
+|H1|
+|H2|
+|H3|
+|H4|
+|H5|
+|H6|
+|H7|
+|H8|
diff --git a/Chess/Features/MovingTheKnight.feature.cs b/Chess/Features/MovingTheKnight.feature.cs
new file mode 100644
index 0000000..5628b39
--- /dev/null
+++ b/Chess/Features/MovingTheKnight.feature.cs
@@ -0,0 +1,509 @@
+// ------------------------------------------------------------------------------
+//
+// This code was generated by SpecFlow (http://www.specflow.org/).
+// SpecFlow Version:1.4.0.0
+// Runtime Version:4.0.30319.1
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+// ------------------------------------------------------------------------------
+#region Designer generated code
+namespace ChessBoard.Features
+{
+ using TechTalk.SpecFlow;
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.4.0.0")]
+ [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [NUnit.Framework.TestFixtureAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Moving the Knight.")]
+ public partial class MovingTheKnight_Feature
+ {
+
+ private static TechTalk.SpecFlow.ITestRunner testRunner;
+
+#line 1 "MovingTheKnight.feature"
+#line hidden
+
+ [NUnit.Framework.TestFixtureSetUpAttribute()]
+ public virtual void FeatureSetup()
+ {
+ testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Moving the Knight.", "In order to play chess\r\nAs a Player\r\nI want to move the Knight legally.", GenerationTargetLanguage.CSharp, ((string[])(null)));
+ testRunner.OnFeatureStart(featureInfo);
+ }
+
+ [NUnit.Framework.TestFixtureTearDownAttribute()]
+ public virtual void FeatureTearDown()
+ {
+ testRunner.OnFeatureEnd();
+ testRunner = null;
+ }
+
+ public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+ {
+ testRunner.OnScenarioStart(scenarioInfo);
+ }
+
+ [NUnit.Framework.TearDownAttribute()]
+ public virtual void ScenarioTearDown()
+ {
+ testRunner.OnScenarioEnd();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Moving the knight legally")]
+ public virtual void MovingTheKnightLegally()
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Moving the knight legally", ((string[])(null)));
+#line 6
+this.ScenarioSetup(scenarioInfo);
+#line 7
+testRunner.Given("I have a Black knight at D4");
+#line 8
+testRunner.And("I have a White pawn at A1");
+#line 9
+testRunner.And("I move the Pawn to A2");
+#line 10
+testRunner.When("I move the Knight to F5");
+#line 11
+testRunner.Then("I should be shown \"Knight to F5\"");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+
+ public virtual void IllegalMove(string position)
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Illegal Move", ((string[])(null)));
+#line 14
+this.ScenarioSetup(scenarioInfo);
+#line 15
+testRunner.Given("I have a Black knight at D4");
+#line hidden
+ TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
+ "move"});
+ table1.AddRow(new string[] {
+ "B3"});
+ table1.AddRow(new string[] {
+ "B5"});
+ table1.AddRow(new string[] {
+ "C2"});
+ table1.AddRow(new string[] {
+ "C6"});
+ table1.AddRow(new string[] {
+ "E2"});
+ table1.AddRow(new string[] {
+ "E6"});
+ table1.AddRow(new string[] {
+ "F3"});
+ table1.AddRow(new string[] {
+ "F5"});
+#line 16
+testRunner.And("the valid moves are", ((string)(null)), table1);
+#line 26
+testRunner.And("I have a White pawn at A1");
+#line 27
+testRunner.And("I move the Pawn to A2");
+#line 28
+testRunner.When(string.Format("I move the Knight to {0}", position));
+#line 29
+testRunner.Then("I should be shown \"Illegal Move\"");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_A1()
+ {
+ this.IllegalMove("A1");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_A2()
+ {
+ this.IllegalMove("A2");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_A3()
+ {
+ this.IllegalMove("A3");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_A4()
+ {
+ this.IllegalMove("A4");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_A5()
+ {
+ this.IllegalMove("A5");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_A6()
+ {
+ this.IllegalMove("A6");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_A7()
+ {
+ this.IllegalMove("A7");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_A8()
+ {
+ this.IllegalMove("A8");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_B1()
+ {
+ this.IllegalMove("B1");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_B2()
+ {
+ this.IllegalMove("B2");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_B4()
+ {
+ this.IllegalMove("B4");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_B6()
+ {
+ this.IllegalMove("B6");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_B7()
+ {
+ this.IllegalMove("B7");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_B8()
+ {
+ this.IllegalMove("B8");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_C1()
+ {
+ this.IllegalMove("C1");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_C3()
+ {
+ this.IllegalMove("C3");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_C4()
+ {
+ this.IllegalMove("C4");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_C5()
+ {
+ this.IllegalMove("C5");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_C7()
+ {
+ this.IllegalMove("C7");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_C8()
+ {
+ this.IllegalMove("C8");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_D1()
+ {
+ this.IllegalMove("D1");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_D2()
+ {
+ this.IllegalMove("D2");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_D3()
+ {
+ this.IllegalMove("D3");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_D4()
+ {
+ this.IllegalMove("D4");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_D5()
+ {
+ this.IllegalMove("D5");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_D6()
+ {
+ this.IllegalMove("D6");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_D7()
+ {
+ this.IllegalMove("D7");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_D8()
+ {
+ this.IllegalMove("D8");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_E1()
+ {
+ this.IllegalMove("E1");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_E3()
+ {
+ this.IllegalMove("E3");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_E4()
+ {
+ this.IllegalMove("E4");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_E5()
+ {
+ this.IllegalMove("E5");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_E7()
+ {
+ this.IllegalMove("E7");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_E8()
+ {
+ this.IllegalMove("E8");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_F1()
+ {
+ this.IllegalMove("F1");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_F2()
+ {
+ this.IllegalMove("F2");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_F4()
+ {
+ this.IllegalMove("F4");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_F6()
+ {
+ this.IllegalMove("F6");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_F7()
+ {
+ this.IllegalMove("F7");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_F8()
+ {
+ this.IllegalMove("F8");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_G1()
+ {
+ this.IllegalMove("G1");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_G2()
+ {
+ this.IllegalMove("G2");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_G3()
+ {
+ this.IllegalMove("G3");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_G4()
+ {
+ this.IllegalMove("G4");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_G5()
+ {
+ this.IllegalMove("G5");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_G6()
+ {
+ this.IllegalMove("G6");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_G7()
+ {
+ this.IllegalMove("G7");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_G8()
+ {
+ this.IllegalMove("G8");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_H1()
+ {
+ this.IllegalMove("H1");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_H2()
+ {
+ this.IllegalMove("H2");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_H3()
+ {
+ this.IllegalMove("H3");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_H4()
+ {
+ this.IllegalMove("H4");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_H5()
+ {
+ this.IllegalMove("H5");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_H6()
+ {
+ this.IllegalMove("H6");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_H7()
+ {
+ this.IllegalMove("H7");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ public virtual void IllegalMove_Positions_H8()
+ {
+ this.IllegalMove("H8");
+ }
+ }
+}
+#endregion
diff --git a/Chess/Features/MovingTheKnight1.feature.cs b/Chess/Features/MovingTheKnight1.feature.cs
new file mode 100644
index 0000000..5760f8c
--- /dev/null
+++ b/Chess/Features/MovingTheKnight1.feature.cs
@@ -0,0 +1,175 @@
+// ------------------------------------------------------------------------------
+//
+// This code was generated by SpecFlow (http://www.specflow.org/).
+// SpecFlow Version:1.5.0.0
+// Runtime Version:4.0.30319.1
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+// ------------------------------------------------------------------------------
+#region Designer generated code
+namespace Chess.Features
+{
+ using TechTalk.SpecFlow;
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.5.0.0")]
+ [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [NUnit.Framework.TestFixtureAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Moving the Knight.")]
+ public partial class MovingTheKnight_Feature
+ {
+
+ private static TechTalk.SpecFlow.ITestRunner testRunner;
+
+#line 1 "MovingTheKnight.feature"
+#line hidden
+
+ [NUnit.Framework.TestFixtureSetUpAttribute()]
+ public virtual void FeatureSetup()
+ {
+ testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Moving the Knight.", "In order to play chess\r\nAs a Player\r\nI want to move the Knight legally.", GenerationTargetLanguage.CSharp, ((string[])(null)));
+ testRunner.OnFeatureStart(featureInfo);
+ }
+
+ [NUnit.Framework.TestFixtureTearDownAttribute()]
+ public virtual void FeatureTearDown()
+ {
+ testRunner.OnFeatureEnd();
+ testRunner = null;
+ }
+
+ public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+ {
+ testRunner.OnScenarioStart(scenarioInfo);
+ }
+
+ [NUnit.Framework.TearDownAttribute()]
+ public virtual void ScenarioTearDown()
+ {
+ testRunner.OnScenarioEnd();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Moving the knight legally")]
+ public virtual void MovingTheKnightLegally()
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Moving the knight legally", ((string[])(null)));
+#line 6
+this.ScenarioSetup(scenarioInfo);
+#line 7
+testRunner.Given("I have a Black Knight at D4");
+#line 8
+testRunner.And("I have a White Pawn at A1");
+#line 9
+testRunner.And("I move the Pawn to A2");
+#line 10
+testRunner.When("I move the Knight to F5");
+#line 11
+testRunner.Then("I should be shown \"Knight to F5\"");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Illegal Move")]
+ [NUnit.Framework.TestCaseAttribute("A1")]
+ [NUnit.Framework.TestCaseAttribute("A2")]
+ [NUnit.Framework.TestCaseAttribute("A3")]
+ [NUnit.Framework.TestCaseAttribute("A4")]
+ [NUnit.Framework.TestCaseAttribute("A5")]
+ [NUnit.Framework.TestCaseAttribute("A6")]
+ [NUnit.Framework.TestCaseAttribute("A7")]
+ [NUnit.Framework.TestCaseAttribute("A8")]
+ [NUnit.Framework.TestCaseAttribute("B1")]
+ [NUnit.Framework.TestCaseAttribute("B2")]
+ [NUnit.Framework.TestCaseAttribute("B4")]
+ [NUnit.Framework.TestCaseAttribute("B6")]
+ [NUnit.Framework.TestCaseAttribute("B7")]
+ [NUnit.Framework.TestCaseAttribute("B8")]
+ [NUnit.Framework.TestCaseAttribute("C1")]
+ [NUnit.Framework.TestCaseAttribute("C3")]
+ [NUnit.Framework.TestCaseAttribute("C4")]
+ [NUnit.Framework.TestCaseAttribute("C5")]
+ [NUnit.Framework.TestCaseAttribute("C7")]
+ [NUnit.Framework.TestCaseAttribute("C8")]
+ [NUnit.Framework.TestCaseAttribute("D1")]
+ [NUnit.Framework.TestCaseAttribute("D2")]
+ [NUnit.Framework.TestCaseAttribute("D3")]
+ [NUnit.Framework.TestCaseAttribute("D4")]
+ [NUnit.Framework.TestCaseAttribute("D5")]
+ [NUnit.Framework.TestCaseAttribute("D6")]
+ [NUnit.Framework.TestCaseAttribute("D7")]
+ [NUnit.Framework.TestCaseAttribute("D8")]
+ [NUnit.Framework.TestCaseAttribute("E1")]
+ [NUnit.Framework.TestCaseAttribute("E3")]
+ [NUnit.Framework.TestCaseAttribute("E4")]
+ [NUnit.Framework.TestCaseAttribute("E5")]
+ [NUnit.Framework.TestCaseAttribute("E7")]
+ [NUnit.Framework.TestCaseAttribute("E8")]
+ [NUnit.Framework.TestCaseAttribute("F1")]
+ [NUnit.Framework.TestCaseAttribute("F2")]
+ [NUnit.Framework.TestCaseAttribute("F4")]
+ [NUnit.Framework.TestCaseAttribute("F6")]
+ [NUnit.Framework.TestCaseAttribute("F7")]
+ [NUnit.Framework.TestCaseAttribute("F8")]
+ [NUnit.Framework.TestCaseAttribute("G1")]
+ [NUnit.Framework.TestCaseAttribute("G2")]
+ [NUnit.Framework.TestCaseAttribute("G3")]
+ [NUnit.Framework.TestCaseAttribute("G4")]
+ [NUnit.Framework.TestCaseAttribute("G5")]
+ [NUnit.Framework.TestCaseAttribute("G6")]
+ [NUnit.Framework.TestCaseAttribute("G7")]
+ [NUnit.Framework.TestCaseAttribute("G8")]
+ [NUnit.Framework.TestCaseAttribute("H1")]
+ [NUnit.Framework.TestCaseAttribute("H2")]
+ [NUnit.Framework.TestCaseAttribute("H3")]
+ [NUnit.Framework.TestCaseAttribute("H4")]
+ [NUnit.Framework.TestCaseAttribute("H5")]
+ [NUnit.Framework.TestCaseAttribute("H6")]
+ [NUnit.Framework.TestCaseAttribute("H7")]
+ [NUnit.Framework.TestCaseAttribute("H8")]
+ public virtual void IllegalMove(string position)
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Illegal Move", ((string[])(null)));
+#line 13
+this.ScenarioSetup(scenarioInfo);
+#line 14
+testRunner.Given("I have a Black Knight at D4");
+#line hidden
+ TechTalk.SpecFlow.Table table1 = new TechTalk.SpecFlow.Table(new string[] {
+ "move"});
+ table1.AddRow(new string[] {
+ "B3"});
+ table1.AddRow(new string[] {
+ "B5"});
+ table1.AddRow(new string[] {
+ "C2"});
+ table1.AddRow(new string[] {
+ "C6"});
+ table1.AddRow(new string[] {
+ "E2"});
+ table1.AddRow(new string[] {
+ "E6"});
+ table1.AddRow(new string[] {
+ "F3"});
+ table1.AddRow(new string[] {
+ "F5"});
+#line 15
+testRunner.And("the valid moves are", ((string)(null)), table1);
+#line 25
+testRunner.And("I have a White Pawn at A1");
+#line 26
+testRunner.And("I move the Pawn to A2");
+#line 27
+testRunner.When(string.Format("I move the Knight to {0}", position));
+#line 28
+testRunner.Then("I should be shown \"Illegal Move\"");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+ }
+}
+#endregion
diff --git a/Chess/Features/PawnMovesLegally.feature b/Chess/Features/PawnMovesLegally.feature
new file mode 100644
index 0000000..9dd1a87
--- /dev/null
+++ b/Chess/Features/PawnMovesLegally.feature
@@ -0,0 +1,110 @@
+Feature: Moving the Pawn.
+In order to play chess
+As a Player
+I want to move the Pawn legally.
+
+Scenario: White Pawn Starts on home row.
+Given the game has just started
+And I have a White Pawn on B2
+And I have a Black Knight on G8
+When I move the White Pawn to B3
+Then I should be shown 'White Pawn to B3'
+And White Pawn should be at B3
+
+Given the game has just started
+And the White Pawn is on E2
+And the Black Knight is at G8
+When I move the White Pawn to E4
+Then I should be shown 'White Pawn to E4'
+And White Pawn should be at E4
+
+Given the game has just started
+And the White Pawn is on D2
+And the Black Knight is at G8
+When I move the White Pawn to D4
+Then I should be shown 'Pawn cannot move 2 spaces unless it in the first round and is on the home row'
+And White Pawn should be at D2
+
+Scenario: Pawn tries taking move when nothing to capture
+Given I have a White Pawn at D7
+And I have a Black Knight at G8
+When I move the White Pawn to C8
+Then I should be shown 'Pawn cannot move diagonally unless it is capturing a piece'
+And White Pawn should be at D7
+
+Scenario Outline: Pawn moves illegally
+Given I have a White Pawn at D7
+And I have a Black Knight at G8
+And the valid moves are D8
+When I move the White Pawn to
+Then I should be shown 'illegal move'
+And White Pawn should be at D7
+
+Scenarios: Positions
+|Position|
+|A1|
+|A2|
+|A3|
+|A4|
+|A5|
+|A6|
+|A7|
+|A8|
+|B1|
+|B2|
+|B3|
+|B4|
+|B5|
+|B6|
+|B7|
+|B8|
+|C1|
+|C2|
+|C3|
+|C4|
+|C5|
+|C6|
+|C7|
+|C8|
+|D1|
+|D2|
+|D3|
+|D4|
+|D5|
+|D6|
+|D7|
+|E1|
+|E2|
+|E3|
+|E4|
+|E5|
+|E7|
+|E8|
+|F1|
+|F2|
+|F3|
+|F4|
+|F5|
+|F6|
+|F7|
+|F8|
+|G1|
+|G2|
+|G3|
+|G4|
+|G5|
+|G6|
+|G7|
+|G8|
+|H1|
+|H2|
+|H3|
+|H4|
+|H5|
+|H6|
+|H7|
+|H8|
+
+
+
+
diff --git a/Chess/Features/PawnMovesLegally.feature.cs b/Chess/Features/PawnMovesLegally.feature.cs
new file mode 100644
index 0000000..439c0d2
--- /dev/null
+++ b/Chess/Features/PawnMovesLegally.feature.cs
@@ -0,0 +1,580 @@
+// ------------------------------------------------------------------------------
+//
+// This code was generated by SpecFlow (http://www.specflow.org/).
+// SpecFlow Version:1.4.0.0
+// Runtime Version:4.0.30319.1
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+// ------------------------------------------------------------------------------
+#region Designer generated code
+namespace ChessBoard.Features
+{
+ using TechTalk.SpecFlow;
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.4.0.0")]
+ [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [NUnit.Framework.TestFixtureAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Moving the Pawn.")]
+ public partial class MovingThePawn_Feature
+ {
+
+ private static TechTalk.SpecFlow.ITestRunner testRunner;
+
+#line 1 "PawnMovesLegally.feature"
+#line hidden
+
+ [NUnit.Framework.TestFixtureSetUpAttribute()]
+ public virtual void FeatureSetup()
+ {
+ testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Moving the Pawn.", "In order to play chess\r\nAs a Player\r\nI want to move the Pawn legally.", GenerationTargetLanguage.CSharp, ((string[])(null)));
+ testRunner.OnFeatureStart(featureInfo);
+ }
+
+ [NUnit.Framework.TestFixtureTearDownAttribute()]
+ public virtual void FeatureTearDown()
+ {
+ testRunner.OnFeatureEnd();
+ testRunner = null;
+ }
+
+ public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+ {
+ testRunner.OnScenarioStart(scenarioInfo);
+ }
+
+ [NUnit.Framework.TearDownAttribute()]
+ public virtual void ScenarioTearDown()
+ {
+ testRunner.OnScenarioEnd();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn Starts on home row.")]
+ public virtual void PawnStartsOnHomeRow_()
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Pawn Starts on home row.", ((string[])(null)));
+#line 6
+this.ScenarioSetup(scenarioInfo);
+#line 7
+testRunner.Given("the game has just started");
+#line 8
+testRunner.And("the Pawn is on B2");
+#line 9
+testRunner.And("the Knight is at G8");
+#line 10
+testRunner.When("I move the Pawn to B3");
+#line 11
+testRunner.Then("I should be shown \"Pawn to B3\"");
+#line 12
+testRunner.And("Pawn should be at B3");
+#line 14
+testRunner.Given("the game has just started");
+#line 15
+testRunner.And("the Pawn is on E2");
+#line 16
+testRunner.And("the Knight is at G8");
+#line 17
+testRunner.When("I move the Pawn to E4");
+#line 18
+testRunner.Then("I should be shown \"Pawn to E4\"");
+#line 19
+testRunner.And("Pawn should be at E4");
+#line 21
+testRunner.Given("the game has not just started");
+#line 22
+testRunner.And("the Pawn is on D2");
+#line 23
+testRunner.And("the Knight is at G8");
+#line 24
+testRunner.When("I move the Pawn to D4");
+#line 25
+testRunner.Then("I should be shown \"Pawn cannot move 2 spaces unless it in the first round and is " +
+ "on the home row.\"");
+#line 26
+testRunner.And("Pawn should be at D2");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn tries taking move when nothing to capture")]
+ public virtual void PawnTriesTakingMoveWhenNothingToCapture()
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Pawn tries taking move when nothing to capture", ((string[])(null)));
+#line 28
+this.ScenarioSetup(scenarioInfo);
+#line 29
+testRunner.Given("I have a White Pawn at D7");
+#line 30
+testRunner.And("I have a Black Knight at G8");
+#line 31
+testRunner.When("I move the Pawn to C8");
+#line 32
+testRunner.Then("I should be shown \"Pawn cannot diagonally unless it is capturing a piece.\"");
+#line 33
+testRunner.And("Pawn should be at D7");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+
+ public virtual void PawnMovesIllegally(string position)
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Pawn moves illegally", ((string[])(null)));
+#line 35
+this.ScenarioSetup(scenarioInfo);
+#line 36
+testRunner.Given("I have a White Pawn at D7");
+#line 37
+testRunner.And("I have a Black Knight at G8");
+#line 38
+testRunner.And("the valid moves are D8");
+#line 39
+testRunner.When(string.Format("I move the Pawn to {0}", position));
+#line 40
+testRunner.Then("I should be shown \"illegal move\"");
+#line 41
+testRunner.And("Pawn should be at D7");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_A1()
+ {
+ this.PawnMovesIllegally("A1");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_A2()
+ {
+ this.PawnMovesIllegally("A2");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_A3()
+ {
+ this.PawnMovesIllegally("A3");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_A4()
+ {
+ this.PawnMovesIllegally("A4");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_A5()
+ {
+ this.PawnMovesIllegally("A5");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_A6()
+ {
+ this.PawnMovesIllegally("A6");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_A7()
+ {
+ this.PawnMovesIllegally("A7");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_A8()
+ {
+ this.PawnMovesIllegally("A8");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_B1()
+ {
+ this.PawnMovesIllegally("B1");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_B2()
+ {
+ this.PawnMovesIllegally("B2");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_B3()
+ {
+ this.PawnMovesIllegally("B3");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_B4()
+ {
+ this.PawnMovesIllegally("B4");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_B5()
+ {
+ this.PawnMovesIllegally("B5");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_B6()
+ {
+ this.PawnMovesIllegally("B6");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_B7()
+ {
+ this.PawnMovesIllegally("B7");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_B8()
+ {
+ this.PawnMovesIllegally("B8");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_C1()
+ {
+ this.PawnMovesIllegally("C1");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_C2()
+ {
+ this.PawnMovesIllegally("C2");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_C3()
+ {
+ this.PawnMovesIllegally("C3");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_C4()
+ {
+ this.PawnMovesIllegally("C4");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_C5()
+ {
+ this.PawnMovesIllegally("C5");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_C6()
+ {
+ this.PawnMovesIllegally("C6");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_C7()
+ {
+ this.PawnMovesIllegally("C7");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_C8()
+ {
+ this.PawnMovesIllegally("C8");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_D1()
+ {
+ this.PawnMovesIllegally("D1");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_D2()
+ {
+ this.PawnMovesIllegally("D2");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_D3()
+ {
+ this.PawnMovesIllegally("D3");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_D4()
+ {
+ this.PawnMovesIllegally("D4");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_D5()
+ {
+ this.PawnMovesIllegally("D5");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_D6()
+ {
+ this.PawnMovesIllegally("D6");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_D7()
+ {
+ this.PawnMovesIllegally("D7");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_E1()
+ {
+ this.PawnMovesIllegally("E1");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_E2()
+ {
+ this.PawnMovesIllegally("E2");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_E3()
+ {
+ this.PawnMovesIllegally("E3");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_E4()
+ {
+ this.PawnMovesIllegally("E4");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_E5()
+ {
+ this.PawnMovesIllegally("E5");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_E7()
+ {
+ this.PawnMovesIllegally("E7");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_E8()
+ {
+ this.PawnMovesIllegally("E8");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_F1()
+ {
+ this.PawnMovesIllegally("F1");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_F2()
+ {
+ this.PawnMovesIllegally("F2");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_F3()
+ {
+ this.PawnMovesIllegally("F3");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_F4()
+ {
+ this.PawnMovesIllegally("F4");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_F5()
+ {
+ this.PawnMovesIllegally("F5");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_F6()
+ {
+ this.PawnMovesIllegally("F6");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_F7()
+ {
+ this.PawnMovesIllegally("F7");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_F8()
+ {
+ this.PawnMovesIllegally("F8");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_G1()
+ {
+ this.PawnMovesIllegally("G1");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_G2()
+ {
+ this.PawnMovesIllegally("G2");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_G3()
+ {
+ this.PawnMovesIllegally("G3");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_G4()
+ {
+ this.PawnMovesIllegally("G4");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_G5()
+ {
+ this.PawnMovesIllegally("G5");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_G6()
+ {
+ this.PawnMovesIllegally("G6");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_G7()
+ {
+ this.PawnMovesIllegally("G7");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_G8()
+ {
+ this.PawnMovesIllegally("G8");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_H1()
+ {
+ this.PawnMovesIllegally("H1");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_H2()
+ {
+ this.PawnMovesIllegally("H2");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_H3()
+ {
+ this.PawnMovesIllegally("H3");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_H4()
+ {
+ this.PawnMovesIllegally("H4");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_H5()
+ {
+ this.PawnMovesIllegally("H5");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_H6()
+ {
+ this.PawnMovesIllegally("H6");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_H7()
+ {
+ this.PawnMovesIllegally("H7");
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ public virtual void PawnMovesIllegally_Positions_H8()
+ {
+ this.PawnMovesIllegally("H8");
+ }
+ }
+}
+#endregion
diff --git a/Chess/Features/PawnMovesLegally1.feature.cs b/Chess/Features/PawnMovesLegally1.feature.cs
new file mode 100644
index 0000000..2dc8993
--- /dev/null
+++ b/Chess/Features/PawnMovesLegally1.feature.cs
@@ -0,0 +1,210 @@
+// ------------------------------------------------------------------------------
+//
+// This code was generated by SpecFlow (http://www.specflow.org/).
+// SpecFlow Version:1.5.0.0
+// Runtime Version:4.0.30319.1
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+// ------------------------------------------------------------------------------
+#region Designer generated code
+namespace Chess.Features
+{
+ using TechTalk.SpecFlow;
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.5.0.0")]
+ [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [NUnit.Framework.TestFixtureAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Moving the Pawn.")]
+ public partial class MovingThePawn_Feature
+ {
+
+ private static TechTalk.SpecFlow.ITestRunner testRunner;
+
+#line 1 "PawnMovesLegally.feature"
+#line hidden
+
+ [NUnit.Framework.TestFixtureSetUpAttribute()]
+ public virtual void FeatureSetup()
+ {
+ testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Moving the Pawn.", "In order to play chess\r\nAs a Player\r\nI want to move the Pawn legally.", GenerationTargetLanguage.CSharp, ((string[])(null)));
+ testRunner.OnFeatureStart(featureInfo);
+ }
+
+ [NUnit.Framework.TestFixtureTearDownAttribute()]
+ public virtual void FeatureTearDown()
+ {
+ testRunner.OnFeatureEnd();
+ testRunner = null;
+ }
+
+ public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+ {
+ testRunner.OnScenarioStart(scenarioInfo);
+ }
+
+ [NUnit.Framework.TearDownAttribute()]
+ public virtual void ScenarioTearDown()
+ {
+ testRunner.OnScenarioEnd();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("White Pawn Starts on home row.")]
+ public virtual void WhitePawnStartsOnHomeRow_()
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("White Pawn Starts on home row.", ((string[])(null)));
+#line 6
+this.ScenarioSetup(scenarioInfo);
+#line 7
+testRunner.Given("the game has just started");
+#line 8
+testRunner.And("I have a White Pawn on B2");
+#line 9
+testRunner.And("I have a Black Knight on G8");
+#line 10
+testRunner.When("I move the White Pawn to B3");
+#line 11
+testRunner.Then("I should be shown \'White Pawn to B3\'");
+#line 12
+testRunner.And("White Pawn should be at B3");
+#line 14
+testRunner.Given("the game has just started");
+#line 15
+testRunner.And("the White Pawn is on E2");
+#line 16
+testRunner.And("the Black Knight is at G8");
+#line 17
+testRunner.When("I move the White Pawn to E4");
+#line 18
+testRunner.Then("I should be shown \'White Pawn to E4\'");
+#line 19
+testRunner.And("White Pawn should be at E4");
+#line 21
+testRunner.Given("the game has just started");
+#line 22
+testRunner.And("the White Pawn is on D2");
+#line 23
+testRunner.And("the Black Knight is at G8");
+#line 24
+testRunner.When("I move the White Pawn to D4");
+#line 25
+testRunner.Then("I should be shown \'Pawn cannot move 2 spaces unless it in the first round and is " +
+ "on the home row\'");
+#line 26
+testRunner.And("White Pawn should be at D2");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn tries taking move when nothing to capture")]
+ public virtual void PawnTriesTakingMoveWhenNothingToCapture()
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Pawn tries taking move when nothing to capture", ((string[])(null)));
+#line 28
+this.ScenarioSetup(scenarioInfo);
+#line 29
+testRunner.Given("I have a White Pawn at D7");
+#line 30
+testRunner.And("I have a Black Knight at G8");
+#line 31
+testRunner.When("I move the White Pawn to C8");
+#line 32
+testRunner.Then("I should be shown \'Pawn cannot move diagonally unless it is capturing a piece\'");
+#line 33
+testRunner.And("White Pawn should be at D7");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn moves illegally")]
+ [NUnit.Framework.TestCaseAttribute("A1")]
+ [NUnit.Framework.TestCaseAttribute("A2")]
+ [NUnit.Framework.TestCaseAttribute("A3")]
+ [NUnit.Framework.TestCaseAttribute("A4")]
+ [NUnit.Framework.TestCaseAttribute("A5")]
+ [NUnit.Framework.TestCaseAttribute("A6")]
+ [NUnit.Framework.TestCaseAttribute("A7")]
+ [NUnit.Framework.TestCaseAttribute("A8")]
+ [NUnit.Framework.TestCaseAttribute("B1")]
+ [NUnit.Framework.TestCaseAttribute("B2")]
+ [NUnit.Framework.TestCaseAttribute("B3")]
+ [NUnit.Framework.TestCaseAttribute("B4")]
+ [NUnit.Framework.TestCaseAttribute("B5")]
+ [NUnit.Framework.TestCaseAttribute("B6")]
+ [NUnit.Framework.TestCaseAttribute("B7")]
+ [NUnit.Framework.TestCaseAttribute("B8")]
+ [NUnit.Framework.TestCaseAttribute("C1")]
+ [NUnit.Framework.TestCaseAttribute("C2")]
+ [NUnit.Framework.TestCaseAttribute("C3")]
+ [NUnit.Framework.TestCaseAttribute("C4")]
+ [NUnit.Framework.TestCaseAttribute("C5")]
+ [NUnit.Framework.TestCaseAttribute("C6")]
+ [NUnit.Framework.TestCaseAttribute("C7")]
+ [NUnit.Framework.TestCaseAttribute("C8")]
+ [NUnit.Framework.TestCaseAttribute("D1")]
+ [NUnit.Framework.TestCaseAttribute("D2")]
+ [NUnit.Framework.TestCaseAttribute("D3")]
+ [NUnit.Framework.TestCaseAttribute("D4")]
+ [NUnit.Framework.TestCaseAttribute("D5")]
+ [NUnit.Framework.TestCaseAttribute("D6")]
+ [NUnit.Framework.TestCaseAttribute("D7")]
+ [NUnit.Framework.TestCaseAttribute("E1")]
+ [NUnit.Framework.TestCaseAttribute("E2")]
+ [NUnit.Framework.TestCaseAttribute("E3")]
+ [NUnit.Framework.TestCaseAttribute("E4")]
+ [NUnit.Framework.TestCaseAttribute("E5")]
+ [NUnit.Framework.TestCaseAttribute("E7")]
+ [NUnit.Framework.TestCaseAttribute("E8")]
+ [NUnit.Framework.TestCaseAttribute("F1")]
+ [NUnit.Framework.TestCaseAttribute("F2")]
+ [NUnit.Framework.TestCaseAttribute("F3")]
+ [NUnit.Framework.TestCaseAttribute("F4")]
+ [NUnit.Framework.TestCaseAttribute("F5")]
+ [NUnit.Framework.TestCaseAttribute("F6")]
+ [NUnit.Framework.TestCaseAttribute("F7")]
+ [NUnit.Framework.TestCaseAttribute("F8")]
+ [NUnit.Framework.TestCaseAttribute("G1")]
+ [NUnit.Framework.TestCaseAttribute("G2")]
+ [NUnit.Framework.TestCaseAttribute("G3")]
+ [NUnit.Framework.TestCaseAttribute("G4")]
+ [NUnit.Framework.TestCaseAttribute("G5")]
+ [NUnit.Framework.TestCaseAttribute("G6")]
+ [NUnit.Framework.TestCaseAttribute("G7")]
+ [NUnit.Framework.TestCaseAttribute("G8")]
+ [NUnit.Framework.TestCaseAttribute("H1")]
+ [NUnit.Framework.TestCaseAttribute("H2")]
+ [NUnit.Framework.TestCaseAttribute("H3")]
+ [NUnit.Framework.TestCaseAttribute("H4")]
+ [NUnit.Framework.TestCaseAttribute("H5")]
+ [NUnit.Framework.TestCaseAttribute("H6")]
+ [NUnit.Framework.TestCaseAttribute("H7")]
+ [NUnit.Framework.TestCaseAttribute("H8")]
+ public virtual void PawnMovesIllegally(string position)
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Pawn moves illegally", ((string[])(null)));
+#line 35
+this.ScenarioSetup(scenarioInfo);
+#line 36
+testRunner.Given("I have a White Pawn at D7");
+#line 37
+testRunner.And("I have a Black Knight at G8");
+#line 38
+testRunner.And("the valid moves are D8");
+#line 39
+testRunner.When(string.Format("I move the White Pawn to {0}", position));
+#line 40
+testRunner.Then("I should be shown \'illegal move\'");
+#line 41
+testRunner.And("White Pawn should be at D7");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+ }
+}
+#endregion
diff --git a/Chess/Features/TakingAPiece.feature b/Chess/Features/TakingAPiece.feature
new file mode 100644
index 0000000..8fcd888
--- /dev/null
+++ b/Chess/Features/TakingAPiece.feature
@@ -0,0 +1,28 @@
+Feature: Taking a piece.
+In order to play chess
+As a Player
+I want to be able to take the oppositions piece.
+
+Scenario: Pawn Takes the Knight
+Given I have a White Pawn at D3
+And I have a Black Knight at C4
+When the Pawn moves to C4
+Then the Knight should be taken
+And the Pawn should be at C4
+And I should be shown "Pawn takes Knight. Pawn wins"
+
+Scenario: Pawn collides with Knight.
+Given I have a White Pawn at C3
+And I have a Black Knight at C4
+When the Pawn moves to C4
+Then the Knight should be at C4
+And the Pawn should be at C3
+And I should be shown "Pawn collides with Knight. Draw"
+
+Scenario: Knight takes Pawn.
+Given I have a Black Knight at D6
+And I have a White Pawn at F6
+And the Pawn moves to F7
+When I move the Knight to F7
+Then the Pawn should be taken
+And I should be shown "Knight takes Pawn. Knight Wins"
diff --git a/Chess/Features/TakingAPiece.feature.cs b/Chess/Features/TakingAPiece.feature.cs
new file mode 100644
index 0000000..39e9ad2
--- /dev/null
+++ b/Chess/Features/TakingAPiece.feature.cs
@@ -0,0 +1,126 @@
+// ------------------------------------------------------------------------------
+//
+// This code was generated by SpecFlow (http://www.specflow.org/).
+// SpecFlow Version:1.4.0.0
+// Runtime Version:4.0.30319.1
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+// ------------------------------------------------------------------------------
+#region Designer generated code
+namespace ChessBoard.Features
+{
+ using TechTalk.SpecFlow;
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.4.0.0")]
+ [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [NUnit.Framework.TestFixtureAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Taking a piece.")]
+ public partial class TakingAPiece_Feature
+ {
+
+ private static TechTalk.SpecFlow.ITestRunner testRunner;
+
+#line 1 "TakingAPiece.feature"
+#line hidden
+
+ [NUnit.Framework.TestFixtureSetUpAttribute()]
+ public virtual void FeatureSetup()
+ {
+ testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Taking a piece.", "In order to play chess\r\nAs a Player\r\nI want to be able to take the oppositions pi" +
+ "ece.", GenerationTargetLanguage.CSharp, ((string[])(null)));
+ testRunner.OnFeatureStart(featureInfo);
+ }
+
+ [NUnit.Framework.TestFixtureTearDownAttribute()]
+ public virtual void FeatureTearDown()
+ {
+ testRunner.OnFeatureEnd();
+ testRunner = null;
+ }
+
+ public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+ {
+ testRunner.OnScenarioStart(scenarioInfo);
+ }
+
+ [NUnit.Framework.TearDownAttribute()]
+ public virtual void ScenarioTearDown()
+ {
+ testRunner.OnScenarioEnd();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn Takes the Knight")]
+ public virtual void PawnTakesTheKnight()
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Pawn Takes the Knight", ((string[])(null)));
+#line 6
+this.ScenarioSetup(scenarioInfo);
+#line 7
+testRunner.Given("I have a White Pawn at D3");
+#line 8
+testRunner.And("I have a Black Knight at C4");
+#line 9
+testRunner.When("the Pawn moves to C4");
+#line 10
+testRunner.Then("the Knight should be taken");
+#line 11
+testRunner.And("the Pawn should be at C4");
+#line 12
+testRunner.And("I should be shown \"Pawn takes Knight. Pawn wins\"");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn collides with Knight.")]
+ public virtual void PawnCollidesWithKnight_()
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Pawn collides with Knight.", ((string[])(null)));
+#line 14
+this.ScenarioSetup(scenarioInfo);
+#line 15
+testRunner.Given("I have a White Pawn at C3");
+#line 16
+testRunner.And("I have a Black Knight at C4");
+#line 17
+testRunner.When("the Pawn moves to C4");
+#line 18
+testRunner.Then("the Knight should be at C4");
+#line 19
+testRunner.And("the Pawn should be at C3");
+#line 20
+testRunner.And("I should be shown \"Pawn collides with Knight. Draw\"");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Knight takes Pawn.")]
+ public virtual void KnightTakesPawn_()
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Knight takes Pawn.", ((string[])(null)));
+#line 22
+this.ScenarioSetup(scenarioInfo);
+#line 23
+testRunner.Given("I have a Black Knight at D6");
+#line 24
+testRunner.And("I have a White Pawn at F6");
+#line 25
+testRunner.And("the Pawn moves to F7");
+#line 26
+testRunner.When("I move the Knight to F7");
+#line 27
+testRunner.Then("the Pawn should be taken");
+#line 28
+testRunner.And("I should be shown \"Knight takes Pawn. Knight Wins\"");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+ }
+}
+#endregion
diff --git a/Chess/Features/TakingAPiece1.feature.cs b/Chess/Features/TakingAPiece1.feature.cs
new file mode 100644
index 0000000..9f46af8
--- /dev/null
+++ b/Chess/Features/TakingAPiece1.feature.cs
@@ -0,0 +1,126 @@
+// ------------------------------------------------------------------------------
+//
+// This code was generated by SpecFlow (http://www.specflow.org/).
+// SpecFlow Version:1.5.0.0
+// Runtime Version:4.0.30319.1
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+// ------------------------------------------------------------------------------
+#region Designer generated code
+namespace Chess.Features
+{
+ using TechTalk.SpecFlow;
+
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("TechTalk.SpecFlow", "1.5.0.0")]
+ [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [NUnit.Framework.TestFixtureAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Taking a piece.")]
+ public partial class TakingAPiece_Feature
+ {
+
+ private static TechTalk.SpecFlow.ITestRunner testRunner;
+
+#line 1 "TakingAPiece.feature"
+#line hidden
+
+ [NUnit.Framework.TestFixtureSetUpAttribute()]
+ public virtual void FeatureSetup()
+ {
+ testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
+ TechTalk.SpecFlow.FeatureInfo featureInfo = new TechTalk.SpecFlow.FeatureInfo(new System.Globalization.CultureInfo("en-US"), "Taking a piece.", "In order to play chess\r\nAs a Player\r\nI want to be able to take the oppositions pi" +
+ "ece.", GenerationTargetLanguage.CSharp, ((string[])(null)));
+ testRunner.OnFeatureStart(featureInfo);
+ }
+
+ [NUnit.Framework.TestFixtureTearDownAttribute()]
+ public virtual void FeatureTearDown()
+ {
+ testRunner.OnFeatureEnd();
+ testRunner = null;
+ }
+
+ public virtual void ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
+ {
+ testRunner.OnScenarioStart(scenarioInfo);
+ }
+
+ [NUnit.Framework.TearDownAttribute()]
+ public virtual void ScenarioTearDown()
+ {
+ testRunner.OnScenarioEnd();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn Takes the Knight")]
+ public virtual void PawnTakesTheKnight()
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Pawn Takes the Knight", ((string[])(null)));
+#line 6
+this.ScenarioSetup(scenarioInfo);
+#line 7
+testRunner.Given("I have a White Pawn at D3");
+#line 8
+testRunner.And("I have a Black Knight at C4");
+#line 9
+testRunner.When("the Pawn moves to C4");
+#line 10
+testRunner.Then("the Knight should be taken");
+#line 11
+testRunner.And("the Pawn should be at C4");
+#line 12
+testRunner.And("I should be shown \"Pawn takes Knight. Pawn wins\"");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Pawn collides with Knight.")]
+ public virtual void PawnCollidesWithKnight_()
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Pawn collides with Knight.", ((string[])(null)));
+#line 14
+this.ScenarioSetup(scenarioInfo);
+#line 15
+testRunner.Given("I have a White Pawn at C3");
+#line 16
+testRunner.And("I have a Black Knight at C4");
+#line 17
+testRunner.When("the Pawn moves to C4");
+#line 18
+testRunner.Then("the Knight should be at C4");
+#line 19
+testRunner.And("the Pawn should be at C3");
+#line 20
+testRunner.And("I should be shown \"Pawn collides with Knight. Draw\"");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+
+ [NUnit.Framework.TestAttribute()]
+ [NUnit.Framework.DescriptionAttribute("Knight takes Pawn.")]
+ public virtual void KnightTakesPawn_()
+ {
+ TechTalk.SpecFlow.ScenarioInfo scenarioInfo = new TechTalk.SpecFlow.ScenarioInfo("Knight takes Pawn.", ((string[])(null)));
+#line 22
+this.ScenarioSetup(scenarioInfo);
+#line 23
+testRunner.Given("I have a Black Knight at D6");
+#line 24
+testRunner.And("I have a White Pawn at F6");
+#line 25
+testRunner.And("the Pawn moves to F7");
+#line 26
+testRunner.When("I move the Knight to F7");
+#line 27
+testRunner.Then("the Pawn should be taken");
+#line 28
+testRunner.And("I should be shown \"Knight takes Pawn. Knight Wins\"");
+#line hidden
+ testRunner.CollectScenarioErrors();
+ }
+ }
+}
+#endregion
diff --git a/Chess/Game.cs b/Chess/Game.cs
new file mode 100644
index 0000000..f09686f
--- /dev/null
+++ b/Chess/Game.cs
@@ -0,0 +1,249 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace Chess
+{
+
+ public struct Position
+ {
+ public static Position NotOnBoard;
+
+ public Position(char y,int x) : this()
+ {
+ this.x = x;
+ this.y = y;
+ }
+
+ public readonly int x;
+ public readonly char y;
+
+ public override string ToString()
+ {
+ return string.Format("{0}{1}", y, x);
+ }
+
+ public bool Equals(Position other)
+ {
+ return other.x == x && other.y == y;
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (ReferenceEquals(null, obj)) return false;
+ if (obj.GetType() != typeof (Position)) return false;
+ return Equals((Position) obj);
+ }
+
+ public override int GetHashCode()
+ {
+ unchecked
+ {
+ return (x*397) ^ y.GetHashCode();
+ }
+ }
+ }
+
+ public abstract class Piece
+ {
+ public override bool Equals(object obj)
+ {
+ return GetType() == obj.GetType();
+ }
+
+ public abstract MovePattern MovePattern(bool isfirst);
+
+ }
+
+ public class WhitePawn : Piece
+ {
+ public override string ToString()
+ {
+ return "White Pawn";
+ }
+
+ public override MovePattern MovePattern(bool isfirst)
+ {
+ if (isfirst) return new PawnInitialPattern();
+ return new PawnStandardPattern();
+ }
+ }
+
+ public class BlackKnight : Piece
+ {
+ public override string ToString()
+ {
+ return "Black Knight";
+ }
+
+ public override MovePattern MovePattern(bool isfirst)
+ {
+ throw new NotImplementedException();
+ }
+ }
+
+
+
+ public class MovePattern
+ {
+ public readonly int yoffset;
+ protected string failuremessage = "invalid move";
+
+ public MovePattern(int yoffset)
+ {
+ this.yoffset = yoffset;
+ }
+
+ public MovePattern(int yoffset, string failuremessage)
+ {
+ this.yoffset = yoffset;
+ this.failuremessage = failuremessage;
+ }
+
+ public bool IsValid(Position from, Position to)
+ {
+ return (from.y - to.y) < yoffset;
+ }
+ }
+
+ public class PawnInitialPattern : MovePattern
+ {
+ public PawnInitialPattern() : base(2, "Pawn cannot move 2 spaces unless it in the first round and is on the home row")
+ {
+ }
+ }
+
+ public class PawnStandardPattern : MovePattern
+ {
+ public PawnStandardPattern()
+ : base(1)
+ {
+ }
+ }
+
+
+ public class Game
+ {
+ protected class InPlay
+ {
+ public InPlay(Piece piece, Position position)
+ {
+ Piece = piece;
+ Position = position;
+ }
+
+ public Piece Piece { get; private set; }
+ public Position Position { get; private set; }
+
+ public void MoveTo(Position position)
+ {
+ Position = position;
+ }
+ }
+
+
+ protected class Move
+ {
+ readonly Position from;
+ Position to;
+ Piece piece;
+ readonly bool isfirst;
+
+ public Move(Position from,Position to, Piece piece,bool isfirst)
+ {
+ this.from = from;
+ this.to = to;
+ this.piece = piece;
+ this.isfirst = isfirst;
+ }
+
+ public bool Valid()
+ {
+ return !OutOfBounds() && MoveIsValidPattern();
+ }
+
+ MoveResult MoveIsValidPattern()
+ {
+ var pattern = piece.MovePattern(isfirst)
+
+ return new MoveResult(pattern);
+
+
+ }
+
+ bool OutOfBounds()
+ {
+ return to.x < 0 || to.x > 8 || to.y < 'A' || to.y > 'H';
+ }
+
+ public void Apply(IEnumerable inplay)
+ {
+ inplay.Where(i => i.Piece.Equals(piece))
+ .First()
+ .MoveTo(to);
+ }
+ }
+
+ protected IList piecesinplay = new List();
+ bool isfirst = true;
+ public string Message { get; protected set; }
+
+ public void MovePieceTo(Piece piece,Position to)
+ {
+ var toMove = piecesinplay.Where(p => p.Piece.Equals(piece))
+ .FirstOrDefault();
+
+ if (toMove == null) throw new InvalidOperationException("No such piece in play " + piece);
+
+ var move = new Move(toMove.Position,to,piece,isfirst);
+
+ if(move.Valid())
+ {
+ move.Apply(piecesinplay);
+ Announce(piece, to);
+ }
+ else
+ AnnounceIllegalMove();
+
+ isfirst = false;
+ }
+
+ void AnnounceIllegalMove()
+ {
+ Message = "illegal move";
+ }
+
+ void Announce(Piece piece, Position position)
+ {
+ Message = string.Format("{0} to {1}", piece, position);
+ }
+
+ public Piece GetPieceAtPosition(Position position)
+ {
+ return piecesinplay.Where(i => i.Position.Equals(position))
+ .Select(i => i.Piece)
+ .FirstOrDefault();
+ }
+
+ public void HasValidMoves(string move)
+ {
+
+ }
+
+ public void PutPieceInPlay(Piece piece, Position position)
+ {
+ piecesinplay.Add(new InPlay(piece,position));
+ }
+ }
+
+ class MoveResult
+ {
+ public readonly bool Valid;
+ public readonly string Message;
+ public MoveResult(bool valid, string message)
+ {
+ Valid = valid;
+ Message = message;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Chess/Properties/AssemblyInfo.cs b/Chess/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..4f9edba
--- /dev/null
+++ b/Chess/Properties/AssemblyInfo.cs
@@ -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("Chess")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("Chess")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
+[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("550f568a-9f9f-40f6-9ccf-8fe1ff27026c")]
+
+// 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")]
diff --git a/Chess/StepDefinitions.cs b/Chess/StepDefinitions.cs
new file mode 100644
index 0000000..f84d35a
--- /dev/null
+++ b/Chess/StepDefinitions.cs
@@ -0,0 +1,81 @@
+using System;
+using System.Reflection;
+using NUnit.Framework;
+using TechTalk.SpecFlow;
+
+namespace Chess
+{
+ public static class The
+ {
+ public static Game Game = new Game();
+ }
+
+ [Binding]
+ public class StepDefinitions
+ {
+ [Given(@"[Tt]he game has just started")]
+ public void StartGame()
+ {
+ }
+
+ // GOD DAMN YOU NOLAN!!!!111one
+ [Given(@"I have a (.*) on (.*)")]
+ [Given(@"I have a (.*) at (.*)")]
+ [Given(@"[Tt]he (.*) is on (.*)")]
+ [Given(@"[Tt]he (.*) is at (.*)")]
+ public void SetPieceAtPosition(string pieceName, string position)
+ {
+ The.Game.PutPieceInPlay(PieceFrom(pieceName), PositionFrom(position));
+ }
+
+ protected Piece PieceFrom(string pieceName)
+ {
+ if (pieceName.ToLower().Contains("pawn"))
+ return new WhitePawn();
+
+ return new BlackKnight();
+ }
+
+ Position PositionFrom(string position)
+ {
+ return new Position(position[0], Convert.ToInt32(position[1].ToString()));
+ }
+
+ [Given(@"I move the (.*) to (.*)")]
+ [When(@"I move the (.*) to (.*)")]
+ public void MovePieceToPosition(string pieceName, string position)
+ {
+ The.Game.MovePieceTo(PieceFrom(pieceName), PositionFrom(position));
+ }
+
+ [Given(@"[Tt]he valid moves are (.*)")]
+ public void AssignValidMoves(string move)
+ {
+ The.Game.HasValidMoves(move);
+ }
+
+ [Then(@"I should be warned of an illegal move message")]
+ public void IllegalMoveMessageIsShown()
+ {
+ MessageIsShown("illegal move");
+ }
+
+ [Then(@"I should be shown '(.*)'")]
+ public void PieceToPositionMessageIsShown(string message)
+ {
+ MessageIsShown(message);
+ }
+
+ public void MessageIsShown(string message)
+ {
+ Assert.That(The.Game.Message, Is.EqualTo(message));
+ }
+
+ [Then(@"(.*) should be at (.*)")]
+ public void PieceIsAtLocation(string pieceName, string position)
+ {
+ var piece = The.Game.GetPieceAtPosition(PositionFrom(position));
+ Assert.That(piece.ToString(), Is.EqualTo(pieceName));
+ }
+ }
+}
\ No newline at end of file
diff --git a/Spec/Class1.cs b/Spec/Class1.cs
new file mode 100644
index 0000000..3f15f2a
--- /dev/null
+++ b/Spec/Class1.cs
@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Spec
+{
+ public class Class1
+ {
+ }
+}
diff --git a/Spec/Properties/AssemblyInfo.cs b/Spec/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..6316eac
--- /dev/null
+++ b/Spec/Properties/AssemblyInfo.cs
@@ -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("Spec")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("Spec")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
+[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("e6cc22ce-946b-413d-82c8-ad7461f0234f")]
+
+// 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")]
diff --git a/Spec/Spec.csproj b/Spec/Spec.csproj
new file mode 100644
index 0000000..29cd28b
--- /dev/null
+++ b/Spec/Spec.csproj
@@ -0,0 +1,54 @@
+
+
+
+ Debug
+ AnyCPU
+ 8.0.30703
+ 2.0
+ {741B926B-D9E8-46B7-8394-046120DF7583}
+ Library
+ Properties
+ Spec
+ Spec
+ v4.0
+ 512
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file