diff options
| author | mo k <mo@mokhan.ca> | 2012-05-30 22:26:04 -0600 |
|---|---|---|
| committer | mo k <mo@mokhan.ca> | 2012-05-30 22:26:04 -0600 |
| commit | 18db302a64ad5ace63861a427ea66e0d29af14f3 (patch) | |
| tree | 39959e18f75fe029a20277b7549cff982136542b /src/specs/infrastructure | |
| parent | c156ffcd25324e4fd49345b7d76df012f8dc1dd9 (diff) | |
register subscribers of different events.main
Diffstat (limited to 'src/specs/infrastructure')
| -rwxr-xr-x | src/specs/infrastructure/EventAggregatorSpec.cs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/specs/infrastructure/EventAggregatorSpec.cs b/src/specs/infrastructure/EventAggregatorSpec.cs index 4d6be1b..f6b0ccb 100755 --- a/src/specs/infrastructure/EventAggregatorSpec.cs +++ b/src/specs/infrastructure/EventAggregatorSpec.cs @@ -1,5 +1,7 @@ +using System.Data;
using Machine.Specifications;
using core.infrastructure;
+using Rhino.Mocks;
namespace specs.infrastructure
{
@@ -19,18 +21,26 @@ namespace specs.infrastructure subscriber.received(x => x.notify("hello"));
};
+ It should_not_notify_subscribers_who_are_not_interested_in_that_particular_event = () =>
+ {
+ uninterested_subscriber.should_not_have_received(x => x.notify(Arg<IDbCommand>.Is.Anything));
+ };
+
Establish context = () =>
{
- subscriber = Mock.An<ISubscribeTo<string>>();
+ subscriber = Mock.an<ISubscribeTo<string>>();
+ uninterested_subscriber = Mock.an<ISubscribeTo<IDbCommand>>();
};
Because of = () =>
{
+ sut.register(uninterested_subscriber);
sut.register(subscriber);
sut.publish("hello");
};
static ISubscribeTo<string> subscriber;
+ static ISubscribeTo<IDbCommand> uninterested_subscriber;
}
}
}
\ No newline at end of file |
