Created
January 14, 2012 20:55
-
-
Save chribben/1612861 to your computer and use it in GitHub Desktop.
Failing MT unit test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Scenario] | |
public class Test_Bus_Subscriptions_For_Consumers_In_Dummy_Saga_Using_Castle_As_IoC : | |
Given_a_service_bus_instance | |
{ | |
readonly IWindsorContainer _container; | |
public Test_Bus_Subscriptions_For_Consumers_In_Dummy_Saga_Using_Castle_As_IoC() | |
{ | |
_container = new WindsorContainer(); | |
_container.Register( | |
Component.For<DummySaga>(), | |
Component.For(typeof(ISagaRepository<>)) | |
.ImplementedBy(typeof(InMemorySagaRepository<>)) | |
.LifeStyle.Singleton); | |
} | |
[Finally] | |
public void Close_container() | |
{ | |
_container.Dispose(); | |
} | |
protected override void SubscribeLocalBus(SubscriptionBusServiceConfigurator subscriptionBusServiceConfigurator) | |
{ | |
subscriptionBusServiceConfigurator.LoadFrom(_container); | |
} | |
[When] | |
public void Registering_a_dummy_saga() | |
{ | |
} | |
[Then] | |
public void Should_have_a_subscription_for_the_first_saga_message() | |
{ | |
LocalBus.HasSubscription<FirstSagaMessage>().Count() | |
.ShouldEqual(1, "No subscription for the FirstSagaMessage was found."); | |
} | |
[Then] | |
public void Should_have_a_subscription_for_the_second_saga_message() | |
{ | |
LocalBus.HasSubscription<SecondSagaMessage>().Count() | |
.ShouldEqual(1, "No subscription for the SecondSagaMessage was found."); | |
} | |
[UsedImplicitly] | |
class DummySaga : ISaga, InitiatedBy<FirstSagaMessage>, Orchestrates<SecondSagaMessage> | |
{ | |
public Guid CorrelationId | |
{ | |
get { return Guid.Empty; } | |
} | |
public IServiceBus Bus { get; set; } | |
public void Consume(FirstSagaMessage message) | |
{ | |
} | |
public void Consume(SecondSagaMessage message) | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment