Commit 4d24c23
Changed files (3)
product
application
application.tests
product/application/ConsoleApplication.cs
@@ -2,7 +2,7 @@ namespace simple.migrations
{
public class ConsoleApplication : Console
{
- ConsoleController controller;
+ readonly ConsoleController controller;
public ConsoleApplication(ConsoleController controller)
{
product/application.tests/application.tests.csproj
@@ -43,6 +43,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\thirdparty\developwithpassion.bdd\developwithpassion.bdddoc.exe</HintPath>
</Reference>
+ <Reference Include="developwithpassion.commons.core.infrastructure, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+ <SpecificVersion>False</SpecificVersion>
+ <HintPath>..\..\thirdparty\developwithpassion.commons\developwithpassion.commons.core.infrastructure.dll</HintPath>
+ </Reference>
<Reference Include="MbUnit.Framework, Version=2.4.2.355, Culture=neutral, PublicKeyToken=5e72ecd30bc408d5">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\thirdparty\mbunit\MbUnit.Framework.dll</HintPath>
product/application.tests/ConsoleSpecs.cs
@@ -9,18 +9,20 @@ namespace tests
{
public abstract class concern : observations_for_a_sut_with_a_contract<Console, ConsoleApplication>
{
- context c = () =>
- {
- console_arguments = new[] {""};
- console_controller = an<ConsoleController>();
- };
+ context c = () => { console_controller = controller.the_dependency<ConsoleController>(); };
- because b = () => { sut.run_against(console_arguments); };
+ protected static ConsoleController console_controller;
+ }
+ public class when_running_a_test : concern
+ {
it should_not_blow_up = () => { console_controller.received(x => x.process(console_arguments)); };
+ context c = () => { console_arguments = new[] {""}; };
+
+ because b = () => { controller.sut.run_against(console_arguments); };
+
static string[] console_arguments;
- static ConsoleController console_controller;
}
}
}
\ No newline at end of file