Skip to content
Browse files

Updated

  • Loading branch information...
1 parent 8595e99 commit 9981b037f34113da880b51033377e4245b00868b @developwithpassion developwithpassion committed Sep 23, 2011
Showing with 63 additions and 72 deletions.
  1. BIN ...on.specifications.rhinomocks.0.4.24.2/developwithpassion.specifications.rhinomocks.0.4.24.2.nupkg
  2. BIN ...s/developwithpassion.specifications.rhinomocks.0.4.24.2/lib/developwithpassion.specifications.dll
  3. BIN ...on.specifications.rhinomocks.0.4.24.3/developwithpassion.specifications.rhinomocks.0.4.24.3.nupkg
  4. BIN ...s/developwithpassion.specifications.rhinomocks.0.4.24.3/lib/developwithpassion.specifications.dll
  5. BIN ... developwithpassion.specifications.rhinomocks.0.4.24.3}/lib/developwithpassion.specifications.pdb
  6. BIN ...hpassion.specifications.rhinomocks.0.4.24.3}/lib/developwithpassion.specifications.rhinomocks.dll
  7. BIN ...hpassion.specifications.rhinomocks.0.4.24.3}/lib/developwithpassion.specifications.rhinomocks.pdb
  8. +1 −1 source/nothinbutdotnetstore.specs/LinkBuilderSpecs.cs
  9. +3 −7 source/nothinbutdotnetstore.specs/LinkSpecs.cs
  10. +17 −18 source/nothinbutdotnetstore.specs/LinkVisitorSpecs.cs
  11. +11 −14 source/nothinbutdotnetstore.specs/TokenStoreSpecs.cs
  12. +4 −4 source/nothinbutdotnetstore.specs/nothinbutdotnetstore.specs.csproj
  13. +7 −7 source/nothinbutdotnetstore.specs/packages.config
  14. +13 −13 source/nothinbutdotnetstore.specs/utility/SpecExtensions.cs
  15. +1 −0 source/nothinbutdotnetstore/tasks/Startup.cs
  16. +0 −2 source/nothinbutdotnetstore/web/core/link_builder/Link.cs
  17. +1 −1 source/nothinbutdotnetstore/web/core/link_builder/Token.cs
  18. +5 −5 source/nothinbutdotnetstore/web/core/link_builder/TokenStore.cs
View
BIN ...fications.rhinomocks.0.4.24.2/developwithpassion.specifications.rhinomocks.0.4.24.2.nupkg
Binary file not shown.
View
BIN ...pwithpassion.specifications.rhinomocks.0.4.24.2/lib/developwithpassion.specifications.dll
Binary file not shown.
View
BIN ...fications.rhinomocks.0.4.24.3/developwithpassion.specifications.rhinomocks.0.4.24.3.nupkg
Binary file not shown.
View
BIN ...pwithpassion.specifications.rhinomocks.0.4.24.3/lib/developwithpassion.specifications.dll
Binary file not shown.
View
BIN ...lib/developwithpassion.specifications.pdb → ...lib/developwithpassion.specifications.pdb
Binary file not shown.
View
BIN ...withpassion.specifications.rhinomocks.dll → ...withpassion.specifications.rhinomocks.dll
Binary file not shown.
View
BIN ...withpassion.specifications.rhinomocks.pdb → ...withpassion.specifications.rhinomocks.pdb
Binary file not shown.
View
2 source/nothinbutdotnetstore.specs/LinkBuilderSpecs.cs
@@ -112,7 +112,7 @@ public class FakeModel
public class FakeToken:Token
{
public string key { get; set; }
- public string value { get; set; }
+ public object value { get; set; }
}
public class FakeVisitor : IProcessAToken
{
View
10 source/nothinbutdotnetstore.specs/LinkSpecs.cs
@@ -1,17 +1,14 @@
-using System.Collections.Generic;
-using Machine.Specifications;
-using developwithpassion.specifications;
-using developwithpassion.specifications.extensions;
+using Machine.Specifications;
using developwithpassion.specifications.rhinomocks;
-using nothinbutdotnetstore.web.core.link_builder;
using nothinbutdotnetstore.specs.utility;
+using nothinbutdotnetstore.web.core.link_builder;
namespace nothinbutdotnetstore.specs
{
[Subject(typeof(Link))]
public class LinkSpecs
{
- public abstract class concern:Observes
+ public abstract class concern : Observes
{
}
@@ -29,7 +26,6 @@ public class when_asked_to_run_a_link : concern
It should_return_the_link_builder_created_using_the_factory = () =>
result.ShouldEqual(link_builder);
-
static IBuildLinks result;
static IBuildLinks link_builder;
}
View
35 source/nothinbutdotnetstore.specs/LinkVisitorSpecs.cs
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using Machine.Specifications;
using developwithpassion.specifications.rhinomocks;
-using developwithpassion.specifications.extensions;
using nothinbutdotnetstore.utility;
using nothinbutdotnetstore.web.core.link_builder;
@@ -16,19 +15,19 @@ public class concern : Observes<IProcessAToken, LinkVisitor>
public class when_visiting_a_request_type_token : concern
{
Establish context = () =>
- {
- var tokens = new List<Token>
- {
- new FakeToken() {key = UrlTokens.request_type, value = "CommandTypeName"}
- };
+ {
+ var tokens = new List<Token>
+ {
+ new FakeToken {key = UrlTokens.request_type, value = "CommandTypeName"}
+ };
- sut_setup.run(x => tokens.visit_all_items_using(x.process));
- };
+ sut_setup.run(x => tokens.visit_all_items_using(x.process));
+ };
Because b = () =>
- {
- result = sut.get_result();
- };
+ {
+ result = sut.get_result();
+ };
It should_return_a_ = () =>
result.ShouldEqual("/run.daxko?" + UrlTokens.request_type + "=CommandTypeName");
@@ -37,16 +36,16 @@ public class when_visiting_a_request_type_token : concern
static string result;
}
- public class when_visiting_a_set_of_tokens_with_parameters: concern
+ public class when_visiting_a_set_of_tokens_with_parameters : concern
{
Establish context = () =>
{
var tokens = new List<Token>
- {
- new FakeToken() {key = UrlTokens.request_type, value = "CommandTypeName"},
- new FakeToken() {key = "id", value = "foo"},
- new FakeToken() {key = "bar", value = "baz"}
- };
+ {
+ new FakeToken {key = UrlTokens.request_type, value = "CommandTypeName"},
+ new FakeToken {key = "id", value = "foo"},
+ new FakeToken {key = "bar", value = "baz"}
+ };
sut_setup.run(x => tokens.visit_all_items_using(x.process));
};
@@ -68,7 +67,7 @@ public class when_visiting_a_set_of_tokens_with_parameters: concern
public class FakeToken : Token
{
public string key { get; set; }
- public string value { get; set; }
+ public object value { get; set; }
}
}
}
View
25 source/nothinbutdotnetstore.specs/TokenStoreSpecs.cs
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.Linq;
+using System.Xml.Schema;
using Machine.Specifications;
using developwithpassion.specifications.rhinomocks;
-using developwithpassion.specifications.extensions;
using nothinbutdotnetstore.web.core.link_builder;
namespace nothinbutdotnetstore.specs
@@ -16,24 +16,21 @@ public class concern : Observes<IManageTokens, TokenStore>
public class when_a_token_has_been_added : concern
{
Establish context = () =>
- {
- token = fake.an<Token>();
- };
+ {
+ tokens = new Dictionary<string,Token>();
+ depends.on(tokens);
+ };
Because b = () =>
- {
- sut.store_token_for("foo", 2);
- };
+ {
+ sut.store_token_for("foo", 2);
+ };
- It should_return_the_token_during_enumeration = () =>
- {
- sut.Where(token => token.key == "foo" && token.value == "2").Count().ShouldEqual(1);
-
- };
+ It should_add_the_token_to_the_underlying_backing_store = () =>
+ tokens["foo"].value.ShouldEqual(2);
static Token token;
+ static IDictionary<string, Token> tokens;
}
-
-
}
}
View
8 source/nothinbutdotnetstore.specs/nothinbutdotnetstore.specs.csproj
@@ -51,13 +51,13 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="developwithpassion.specifications, Version=0.4.24.2, Culture=neutral, processorArchitecture=MSIL">
+ <Reference Include="developwithpassion.specifications, Version=0.4.24.3, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\packages\developwithpassion.specifications.rhinomocks.0.4.24.2\lib\developwithpassion.specifications.dll</HintPath>
+ <HintPath>..\..\packages\developwithpassion.specifications.rhinomocks.0.4.24.3\lib\developwithpassion.specifications.dll</HintPath>
</Reference>
- <Reference Include="developwithpassion.specifications.rhinomocks, Version=0.4.24.2, Culture=neutral, processorArchitecture=MSIL">
+ <Reference Include="developwithpassion.specifications.rhinomocks, Version=0.4.24.3, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\packages\developwithpassion.specifications.rhinomocks.0.4.24.2\lib\developwithpassion.specifications.rhinomocks.dll</HintPath>
+ <HintPath>..\..\packages\developwithpassion.specifications.rhinomocks.0.4.24.3\lib\developwithpassion.specifications.rhinomocks.dll</HintPath>
</Reference>
<Reference Include="Machine.Fakes, Version=0.2.6.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
View
14 source/nothinbutdotnetstore.specs/packages.config
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="Machine.Specifications" version="0.4.9.0" />
- <package id="Machine.Fakes" version="0.2.1.2" />
- <package id="Moq" version="4.0.10827" />
- <package id="Machine.Fakes.Moq" version="0.2.1.2" />
<package id="developwithpassion.specifications.moq" version="0.4.0.5" />
- <package id="RhinoMocks" version="3.6" />
- <package id="Machine.Specifications" version="0.4.24.0" />
+ <package id="developwithpassion.specifications.rhinomocks" version="0.4.24.3" />
+ <package id="Machine.Fakes" version="0.2.1.2" />
<package id="Machine.Fakes" version="0.2.6" />
+ <package id="Machine.Fakes.Moq" version="0.2.1.2" />
<package id="Machine.Fakes.RhinoMocks" version="0.2.6" />
- <package id="developwithpassion.specifications.rhinomocks" version="0.4.24.2" />
+ <package id="Machine.Specifications" version="0.4.9.0" />
+ <package id="Machine.Specifications" version="0.4.24.0" />
+ <package id="Moq" version="4.0.10827" />
+ <package id="RhinoMocks" version="3.6" />
</packages>
View
26 source/nothinbutdotnetstore.specs/utility/SpecExtensions.cs
@@ -1,27 +1,27 @@
using developwithpassion.specifications.core;
using developwithpassion.specifications.extensions;
-using nothinbutdotnetstore.utility;
using nothinbutdotnetstore.utility.containers;
namespace nothinbutdotnetstore.specs.utility
{
public static class SpecExtensions
{
- public static void prepare_container_resolved<Dependency>(this IConfigureSetupPairs spec, ICreateFakes fakes,Dependency dependency)
+ public static void prepare_container_resolved<Dependency>(this IConfigureSetupPairs spec, ICreateFakes fakes,
+ Dependency dependency)
{
-
+ var current_resolver = Depends.container_resolver;
spec.add_setup_teardown_pair(() =>
- {
- var container = fakes.an<IFetchDependencies>();
- container.setup(x => x.a<Dependency>()).Return(dependency);
-
- ContainerResolver resolver = () => container;
- Depends.container_resolver = resolver;
- }, () =>
- {
+ {
+ var container = fakes.an<IFetchDependencies>();
+ container.setup(x => x.a<Dependency>()).Return(dependency);
- });
- }
+ ContainerResolver resolver = () => container;
+ Depends.container_resolver = resolver;
+ }, () =>
+ {
+ Depends.container_resolver = current_resolver;
+ });
+ }
}
}
View
1 source/nothinbutdotnetstore/tasks/Startup.cs
@@ -45,6 +45,7 @@ static void populate_factories()
Depends.on.a<IProcessOneRequest>()));
register<IEnumerable<IProcessOneRequest>>(() => Stub.with<StubSetOfCommands>());
+ register<IProcessOneRequest>(() => Stub.with<StubMissingCommand>());
register<IMapAnInputModelOf<ViewMainDepartmentsRequest>>(() => new StubInputModelMapper<ViewMainDepartmentsRequest>());
register<IMapAnInputModelOf<ViewTheDepartmentsOfADepartmentRequest>>(() => new StubInputModelMapper<ViewTheDepartmentsOfADepartmentRequest>());
View
2 source/nothinbutdotnetstore/web/core/link_builder/Link.cs
@@ -1,11 +1,9 @@
-using System;
using nothinbutdotnetstore.utility.containers;
namespace nothinbutdotnetstore.web.core.link_builder
{
public class Link
{
-
public static IBuildLinks to_run<T>()
{
return Depends.on.a<IBuildLinks>();
View
2 source/nothinbutdotnetstore/web/core/link_builder/Token.cs
@@ -3,6 +3,6 @@
public interface Token
{
string key { get; set; }
- string value { get; set; }
+ object value { get; set; }
}
}
View
10 source/nothinbutdotnetstore/web/core/link_builder/TokenStore.cs
@@ -5,16 +5,16 @@ namespace nothinbutdotnetstore.web.core.link_builder
{
public class TokenStore : IManageTokens
{
- IDictionary<string, Token> _inner = new Dictionary<string, Token>();
+ public IDictionary<string, Token> items = new Dictionary<string, Token>();
public IEnumerator<Token> GetEnumerator()
{
- return _inner.Values.GetEnumerator();
+ return items.Values.GetEnumerator();
}
public void store_token_for(string token_key, object value)
{
- _inner[token_key] = new TokenImpl(token_key, value.ToString());
+ items[token_key] = new TokenImpl(token_key, value);
}
IEnumerator IEnumerable.GetEnumerator()
@@ -24,14 +24,14 @@ IEnumerator IEnumerable.GetEnumerator()
class TokenImpl : Token
{
- public TokenImpl(string token_key, string provided_value)
+ public TokenImpl(string token_key, object provided_value)
{
key = token_key;
value = provided_value;
}
public string key { get; set; }
- public string value { get; set; }
+ public object value { get; set; }
}
}
}

0 comments on commit 9981b03

Please sign in to comment.
Something went wrong with that request. Please try again.