Commit 4c9ba6b

mo_khan <mo@mokhan.ca>
2009-05-24 15:28:32
separated layers by namespaces and updated namespace references
1 parent 27836d6
product/project/Command.cs → product/project/common/Command.cs
@@ -1,4 +1,4 @@
-namespace mars.rover
+namespace mars.rover.common
 {
     public interface Command
     {
product/project/Coordinate.cs → product/project/domain/Coordinate.cs
@@ -1,7 +1,7 @@
 using System;
 using System.Globalization;
 
-namespace mars.rover
+namespace mars.rover.domain
 {
     public class Coordinate : IEquatable<Coordinate>, IComparable<Coordinate>
     {
product/project/East.cs → product/project/domain/East.cs
@@ -1,4 +1,4 @@
-namespace mars.rover
+namespace mars.rover.domain
 {
     public class East : Heading
     {
product/project/Heading.cs → product/project/domain/Heading.cs
@@ -1,6 +1,6 @@
 using System;
 
-namespace mars.rover
+namespace mars.rover.domain
 {
     public interface Heading : IEquatable<Heading>
     {
product/project/Headings.cs → product/project/domain/Headings.cs
@@ -1,4 +1,4 @@
-namespace mars.rover
+namespace mars.rover.domain
 {
     static public class Headings
     {
@@ -6,12 +6,12 @@ namespace mars.rover
         static public Heading East = new East(new DefaultPlateau());
         static public Heading West = new West(new DefaultPlateau());
         static public Heading South = new South(new DefaultPlateau());
-    }
 
-    public class DefaultPlateau : Mars
-    {
-        public DefaultPlateau() : base(5, 5)
+        class DefaultPlateau : Mars
         {
+            public DefaultPlateau() : base(5, 5)
+            {
+            }
         }
     }
 }
\ No newline at end of file
product/project/Mars.cs → product/project/domain/Mars.cs
@@ -1,4 +1,4 @@
-namespace mars.rover
+namespace mars.rover.domain
 {
     public class Mars : Plateau
     {
product/project/NASA.cs → product/project/domain/NASA.cs
@@ -1,4 +1,4 @@
-namespace mars.rover
+namespace mars.rover.domain
 {
     public class NASA
     {
product/project/North.cs → product/project/domain/North.cs
@@ -1,4 +1,4 @@
-namespace mars.rover
+namespace mars.rover.domain
 {
     public class North : Heading
     {
product/project/Plateau.cs → product/project/domain/Plateau.cs
@@ -1,4 +1,4 @@
-namespace mars.rover
+namespace mars.rover.domain
 {
     public interface Plateau
     {
product/project/Rover.cs → product/project/domain/Rover.cs
@@ -1,4 +1,4 @@
-namespace mars.rover
+namespace mars.rover.domain
 {
     public class Rover
     {
product/project/South.cs → product/project/domain/South.cs
@@ -1,4 +1,4 @@
-namespace mars.rover
+namespace mars.rover.domain
 {
     public class South : Heading
     {
product/project/West.cs → product/project/domain/West.cs
@@ -1,4 +1,4 @@
-namespace mars.rover
+namespace mars.rover.domain
 {
     public class West : Heading
     {
product/project/CallbackCommand.cs → product/project/presentation/infrastructure/CallbackCommand.cs
@@ -1,4 +1,4 @@
-namespace mars.rover
+namespace mars.rover.presentation.infrastructure
 {
     public interface CallbackCommand<T> : ParameterizedCommand<T>
     {
product/project/CommandProcessor.cs → product/project/presentation/infrastructure/CommandProcessor.cs
@@ -1,4 +1,6 @@
-namespace mars.rover
+using mars.rover.common;
+
+namespace mars.rover.presentation.infrastructure
 {
     public interface CommandProcessor : Command
     {
product/project/ParameterizedCommand.cs → product/project/presentation/infrastructure/ParameterizedCommand.cs
@@ -1,4 +1,4 @@
-namespace mars.rover
+namespace mars.rover.presentation.infrastructure
 {
     public interface ParameterizedCommand<T>
     {
product/project/CaptureUserInstructionsConsoleView.cs → product/project/presentation/CaptureUserInstructionsConsoleView.cs
@@ -1,6 +1,6 @@
 using System.IO;
 
-namespace mars.rover
+namespace mars.rover.presentation
 {
     public class CaptureUserInstructionsConsoleView : CaptureUserInstructionsView
     {
product/project/CaptureUserInstructionsPresenter.cs → product/project/presentation/CaptureUserInstructionsPresenter.cs
@@ -1,8 +1,9 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using mars.rover.domain;
 
-namespace mars.rover
+namespace mars.rover.presentation
 {
     public class CaptureUserInstructionsPresenter : Presenter
     {
product/project/CaptureUserInstructionsView.cs → product/project/presentation/CaptureUserInstructionsView.cs
@@ -1,4 +1,4 @@
-namespace mars.rover
+namespace mars.rover.presentation
 {
     public interface CaptureUserInstructionsView
     {
product/project/CommandLineArgument.cs → product/project/presentation/CommandLineArgument.cs
@@ -1,4 +1,4 @@
-namespace mars.rover
+namespace mars.rover.presentation
 {
     public class CommandLineArgument
     {
product/project/presentation/Presenter.cs
@@ -0,0 +1,8 @@
+using mars.rover.common;
+
+namespace mars.rover.presentation
+{
+    public interface Presenter : Command
+    {
+    }
+}
\ No newline at end of file
product/project/Position.cs
@@ -1,26 +0,0 @@
-using System;
-
-namespace mars.rover
-{
-    public class Position
-    {
-        public Position(int x, int y, Heading heading)
-        {
-        }
-
-        public virtual void change_heading_to_left()
-        {
-            throw new NotImplementedException();
-        }
-
-        public virtual void change_heading_to_right()
-        {
-            throw new NotImplementedException();
-        }
-
-        public virtual void advance()
-        {
-            throw new NotImplementedException();
-        }
-    }
-}
\ No newline at end of file
product/project/Presenter.cs
@@ -1,7 +0,0 @@
-namespace mars.rover
-{
-    public interface Presenter : Command
-    {
-        
-    }
-}
\ No newline at end of file
product/project/Program.cs
@@ -1,6 +1,8 @@
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using mars.rover.presentation;
+using mars.rover.presentation.infrastructure;
 
 namespace mars.rover
 {
product/project/project.csproj
@@ -45,29 +45,28 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="CallbackCommand.cs" />
-    <Compile Include="CaptureUserInstructionsConsoleView.cs" />
-    <Compile Include="CaptureUserInstructionsView.cs" />
-    <Compile Include="Command.cs" />
-    <Compile Include="CommandLineArgument.cs" />
-    <Compile Include="CommandProcessor.cs" />
-    <Compile Include="Coordinate.cs" />
-    <Compile Include="East.cs" />
-    <Compile Include="Heading.cs" />
-    <Compile Include="Headings.cs" />
-    <Compile Include="NASA.cs" />
-    <Compile Include="North.cs" />
-    <Compile Include="ParameterizedCommand.cs" />
-    <Compile Include="Mars.cs" />
-    <Compile Include="Plateau.cs" />
-    <Compile Include="Position.cs" />
-    <Compile Include="Presenter.cs" />
-    <Compile Include="CaptureUserInstructionsPresenter.cs" />
+    <Compile Include="presentation\infrastructure\CallbackCommand.cs" />
+    <Compile Include="presentation\CaptureUserInstructionsConsoleView.cs" />
+    <Compile Include="presentation\CaptureUserInstructionsView.cs" />
+    <Compile Include="common\Command.cs" />
+    <Compile Include="presentation\CommandLineArgument.cs" />
+    <Compile Include="presentation\infrastructure\CommandProcessor.cs" />
+    <Compile Include="domain\Coordinate.cs" />
+    <Compile Include="domain\East.cs" />
+    <Compile Include="domain\Heading.cs" />
+    <Compile Include="domain\Headings.cs" />
+    <Compile Include="domain\NASA.cs" />
+    <Compile Include="domain\North.cs" />
+    <Compile Include="presentation\infrastructure\ParameterizedCommand.cs" />
+    <Compile Include="domain\Mars.cs" />
+    <Compile Include="domain\Plateau.cs" />
+    <Compile Include="presentation\Presenter.cs" />
+    <Compile Include="presentation\CaptureUserInstructionsPresenter.cs" />
     <Compile Include="Program.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="Rover.cs" />
-    <Compile Include="South.cs" />
-    <Compile Include="West.cs" />
+    <Compile Include="domain\Rover.cs" />
+    <Compile Include="domain\South.cs" />
+    <Compile Include="domain\West.cs" />
   </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
product/project.specifications/CoordinateSpecs.cs → product/project.specifications/domain/CoordinateSpecs.cs
@@ -1,9 +1,9 @@
 using developwithpassion.bdd.contexts;
 using developwithpassion.bdd.mbunit;
 using developwithpassion.bdd.mbunit.standard.observations;
-using mars.rover;
+using mars.rover.domain;
 
-namespace specifications
+namespace specifications.domain
 {
     public class CoordinateSpecs
     {
product/project.specifications/EastSpecs.cs → product/project.specifications/domain/EastSpecs.cs
@@ -1,9 +1,9 @@
 using developwithpassion.bdd.contexts;
 using developwithpassion.bdd.mbunit;
 using developwithpassion.bdd.mbunit.standard.observations;
-using mars.rover;
+using mars.rover.domain;
 
-namespace specifications
+namespace specifications.domain
 {
     public class EastSpecs
     {
product/project.specifications/MarsSpecs.cs → product/project.specifications/domain/MarsSpecs.cs
@@ -1,9 +1,9 @@
 using developwithpassion.bdd.contexts;
 using developwithpassion.bdd.mbunit;
 using developwithpassion.bdd.mbunit.standard.observations;
-using mars.rover;
+using mars.rover.domain;
 
-namespace specifications
+namespace specifications.domain
 {
     public class MarsSpecs
     {
product/project.specifications/NASASpecs.cs → product/project.specifications/domain/NASASpecs.cs
@@ -1,9 +1,9 @@
 using developwithpassion.bdd.contexts;
 using developwithpassion.bdd.mbunit;
 using developwithpassion.bdd.mbunit.standard.observations;
-using mars.rover;
+using mars.rover.domain;
 
-namespace specifications
+namespace specifications.domain
 {
     public class NASASpecs
     {
product/project.specifications/NorthSpecs.cs → product/project.specifications/domain/NorthSpecs.cs
@@ -1,9 +1,9 @@
 using developwithpassion.bdd.contexts;
 using developwithpassion.bdd.mbunit;
 using developwithpassion.bdd.mbunit.standard.observations;
-using mars.rover;
+using mars.rover.domain;
 
-namespace specifications
+namespace specifications.domain
 {
     public class NorthSpecs
     {
product/project.specifications/PositionSpecs.cs → product/project.specifications/domain/PositionSpecs.cs
@@ -1,4 +1,4 @@
-namespace specifications
+namespace specifications.domain
 {
     public class PositionSpecs
     {
product/project.specifications/RoverSpecs.cs → product/project.specifications/domain/RoverSpecs.cs
@@ -1,9 +1,9 @@
 using developwithpassion.bdd.contexts;
 using developwithpassion.bdd.mbunit;
 using developwithpassion.bdd.mbunit.standard.observations;
-using mars.rover;
+using mars.rover.domain;
 
-namespace specifications
+namespace specifications.domain
 {
     public class RoverSpecs
     {
product/project.specifications/SouthSpecs.cs → product/project.specifications/domain/SouthSpecs.cs
@@ -1,14 +1,15 @@
 using developwithpassion.bdd.contexts;
 using developwithpassion.bdd.mbunit;
 using developwithpassion.bdd.mbunit.standard.observations;
-using mars.rover;
+using mars.rover.domain;
 
-namespace specifications
+namespace specifications.domain
 {
     public class SouthSpecs
     {
         
     }
+
     public class when_at_the_most_southern_point_on_the_plateau_and_attempting_to_move_forward_one_grid_point :
         observations_for_a_sut_with_a_contract<Heading, South>
     {
product/project.specifications/WestSpecs.cs → product/project.specifications/domain/WestSpecs.cs
@@ -1,9 +1,9 @@
 using developwithpassion.bdd.contexts;
 using developwithpassion.bdd.mbunit;
 using developwithpassion.bdd.mbunit.standard.observations;
-using mars.rover;
+using mars.rover.domain;
 
-namespace specifications
+namespace specifications.domain
 {
     public class WestSpecs
     {
product/project.specifications/CaptureUserInstructionsPresenterSpecs.cs → product/project.specifications/presentation/CaptureUserInstructionsPresenterSpecs.cs
@@ -1,9 +1,9 @@
 using developwithpassion.bdd;
 using developwithpassion.bdd.contexts;
 using developwithpassion.bdd.mbunit.standard.observations;
-using mars.rover;
+using mars.rover.presentation;
 
-namespace specifications
+namespace specifications.presentation
 {
     public class CaptureUserInstructionsPresenterSpecs
     {
product/project.specifications/Class1.cs
@@ -1,32 +0,0 @@
-using developwithpassion.bdd.contexts;
-using developwithpassion.bdd.mbunit;
-using developwithpassion.bdd.mbunit.standard.observations;
-using MbUnit.Framework;
-
-namespace specifications
-{
-    [TestFixture]
-    public class Class1
-    {
-        [Test]
-        public void should_blow_up()
-        {
-            Assert.AreEqual(1, 1);
-        }
-    }
-
-    public class when_told_to_foo : observations_for_a_sut_without_a_contract<Foo>
-    {
-        it should_bar = () => new Foo().name.should_not_be_null();
-    }
-
-    public class Foo
-    {
-        public Foo()
-        {
-            name = "mo";
-        }
-
-        public string name { get; set; }
-    }
-}
\ No newline at end of file
product/project.specifications/ProgramSpecs.cs
@@ -3,6 +3,8 @@ using developwithpassion.bdd;
 using developwithpassion.bdd.contexts;
 using developwithpassion.bdd.mbunit.standard.observations;
 using mars.rover;
+using mars.rover.presentation;
+using mars.rover.presentation.infrastructure;
 
 namespace specifications
 {
product/project.specifications/project.specifications.csproj
@@ -65,19 +65,18 @@
     <Reference Include="System.Xml" />
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="CoordinateSpecs.cs" />
-    <Compile Include="EastSpecs.cs" />
-    <Compile Include="NorthSpecs.cs" />
-    <Compile Include="MarsSpecs.cs" />
-    <Compile Include="Class1.cs" />
-    <Compile Include="CaptureUserInstructionsPresenterSpecs.cs" />
-    <Compile Include="NASASpecs.cs" />
-    <Compile Include="PositionSpecs.cs" />
+    <Compile Include="domain\CoordinateSpecs.cs" />
+    <Compile Include="domain\EastSpecs.cs" />
+    <Compile Include="domain\NorthSpecs.cs" />
+    <Compile Include="domain\MarsSpecs.cs" />
+    <Compile Include="presentation\CaptureUserInstructionsPresenterSpecs.cs" />
+    <Compile Include="domain\NASASpecs.cs" />
+    <Compile Include="domain\PositionSpecs.cs" />
     <Compile Include="ProgramSpecs.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="RoverSpecs.cs" />
-    <Compile Include="SouthSpecs.cs" />
-    <Compile Include="WestSpecs.cs" />
+    <Compile Include="domain\RoverSpecs.cs" />
+    <Compile Include="domain\SouthSpecs.cs" />
+    <Compile Include="domain\WestSpecs.cs" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\project\project.csproj">