public void A_consumer_is_being_tested() { _test = TestFactory.ForHandler<InputMessage>() .New(x => { x.Handler((bus,message) => { bus.MessageContext<InputMessage>().Respond(new OutputMessage()); }); x.Send(new InputMessage(), c => c.SendResponseTo(_test.Scenario.Bus)); x.Send(new InputMessage(), c => c.SendResponseTo(_test.Scenario.Bus)); }); _test.Execute(); _test.Received.Any<InputMessage>().ShouldBeTrue(); _test.Sent.Any<OutputMessage>().ShouldBeTrue(); _future = new FutureMessage<ReceivedMessageTraceList>(); _test.Scenario.Bus.GetMessageTrace(_test.Scenario.Bus.ControlBus.Endpoint, _future.Set); _future.IsAvailable(8.Seconds()).ShouldBeTrue(); _list = _future.Message; }
public void Setup() { _test = TestFactory.ForHandler<A>() .New(x => { x.Send(new A()); x.Send(new B()); }); _test.Execute(); }
public void Setup() { _test = TestFactory.ForHandler <A>() .New(x => { x.Send(new A()); x.Send(new B()); }); _test.Execute(); }
public void A_handler_responds_to_a_message_using_context() { _test = TestFactory.ForHandler <A>() .New(x => { x.Handler((context, message) => context.Respond(new B())); x.Send(new A(), (scenario, context) => context.SendResponseTo(scenario.Bus)); }); _test.Execute(); }
public void Setup() { _test = TestFactory.ForHandler<A>() .New(x => { x.UseRabbitMqBusScenario(); x.Send(new A()); x.Send(new B()); }); _test.Execute(); }
public void Setup() { _test = TestFactory.ForHandler <A>() .New(x => { x.UseRabbitMqBusScenario(); x.Send(new A()); x.Send(new B()); }); _test.Execute(); }
public void A_handler_responds_to_a_message_using_context() { _test = TestFactory.ForHandler<A>() .New(x => { x.Handler((context, message) => context.Respond(new B())); x.Send(new A(), (scenario, context) => context.SendResponseTo(scenario.Bus)); }); _test.Execute(); }
public void Setup() { _test = TestFactory.ForHandler <A>() .InLocalRemoteBusScenario() .New(x => { x.Send(new A()); x.Send(new B()); }); _test.Execute(); }
public void Setup() { _test = TestFactory.ForHandler<A>() .New(x => { x.UseAzureServiceBusBusScenario(new AccountDetails()); x.Send(new A()); x.Send(new B()); }); _test.Execute(); }
public void Setup() { _test = TestFactory.ForHandler <A>() .New(x => { x.UseAzureServiceBusBusScenario(new AccountDetails()); x.Send(new A()); x.Send(new B()); }); _test.Execute(); }
public void Setup() { _test = TestFactory.ForHandler <A>() .New(x => { // this does not work because subscription notifications are not present with Azure x.UseAzureServiceBusBusScenario(new AccountDetails()); x.Send(new A()); x.Send(new B()); }); _test.Execute(); }
public void Setup() { _test = TestFactory.ForHandler<A>() .New(x => { // this does not work because subscription notifications are not present with Azure x.UseAzureServiceBusBusScenario(new AccountDetails()); x.Send(new A()); x.Send(new B()); }); _test.Execute(); }
public void A_message_has_no_default_constructor() { _test = TestFactory.ForHandler <A>() .New(x => { _sent = new A("Dru", "Sellers"); x.Send(_sent); x.Handler((context, message) => { _received = message; }); }); _test.Execute(); _test.Received.Any <A>().ShouldBeTrue(); }
public void A_message_has_no_default_constructor() { _test = TestFactory.ForHandler<A>() .New(x => { _sent = new A("Dru", "Sellers"); x.Send(_sent); x.Handler((context, message) => { _received = message; }); }); _test.Execute(); _test.Received.Any<A>().ShouldBeTrue(); }
public void Setup() { _test = TestFactory.ForHandler<A>() .New(x => { _sent = new A { Contents = new byte[] {0x56, 0x34, 0xf3} }; x.Send(_sent); x.Handler((context, message) => { _received = message; }); }); _test.Execute(); _test.Received.Any<A>().ShouldBeTrue(); }
public void Setup() { _test = TestFactory.ForHandler <A>() .New(x => { _sent = new A { Contents = new byte[] { 0x56, 0x34, 0xf3 } }; x.Send(_sent); x.Handler((context, message) => { _received = message; }); }); _test.Execute(); _test.Received.Any <A>().ShouldBeTrue(); }
public void Setup() { _test = TestFactory.ForHandler<A>() .New(x => { _sent = new A { Local = new DateTime(2001, 9, 11, 8, 46, 30, DateTimeKind.Local), Universal = new DateTime(2001, 9, 11, 9, 3, 2, DateTimeKind.Local).ToUniversalTime(), }; x.Send(_sent); x.Handler((context, message) => { _received = message; }); }); _test.Execute(); _test.Received.Any<A>().ShouldBeTrue(); }
public void Setup() { _test = TestFactory.ForHandler <A>() .New(x => { _sent = new A { Local = new DateTime(2001, 9, 11, 8, 46, 30, DateTimeKind.Local), Universal = new DateTime(2001, 9, 11, 9, 3, 2, DateTimeKind.Local).ToUniversalTime(), }; x.Send(_sent); x.Handler((context, message) => { _received = message; }); }); _test.Execute(); _test.Received.Any <A>().ShouldBeTrue(); }
public void A_consumer_is_being_tested() { _test = TestFactory.ForHandler <InputMessage>() .New(x => { x.Handler((context, message) => context.Respond(new OutputMessage())); x.Send(new InputMessage(), (scenario, context) => context.SendResponseTo(scenario.Bus)); x.Send(new InputMessage(), (scenario, context) => context.SendResponseTo(scenario.Bus)); }); _test.Execute(); _test.Received.Any <InputMessage>().ShouldBeTrue(); _test.Sent.Any <OutputMessage>().ShouldBeTrue(); _future = new FutureMessage <ReceivedMessageTraceList>(); _test.Scenario.Bus.GetMessageTrace(_test.Scenario.Bus.ControlBus.Endpoint, _future.Set); _future.IsAvailable(8.Seconds()).ShouldBeTrue(); _list = _future.Message; }
public void Setup() { _test = TestFactory.ForHandler<A>() .InLocalRemoteBusScenario() .New(x => { x.Send(new A()); x.Send(new B()); }); _test.Execute(); }