Пример #1
0
		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;
		}
Пример #2
0
		public void Setup()
		{
			_test = TestFactory.ForHandler<A>()
				.New(x =>
					{
						x.Send(new A());
						x.Send(new B());
					});

			_test.Execute();
		}
Пример #3
0
        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();
        }
Пример #5
0
		public void Setup()
		{
			_test = TestFactory.ForHandler<A>()
				.New(x =>
					{
						x.UseRabbitMqBusScenario();

						x.Send(new A());
						x.Send(new B());
					});
			_test.Execute();
		}
Пример #6
0
        public void Setup()
        {
            _test = TestFactory.ForHandler <A>()
                    .New(x =>
            {
                x.UseRabbitMqBusScenario();

                x.Send(new A());
                x.Send(new B());
            });
            _test.Execute();
        }
Пример #7
0
		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();
		}
Пример #8
0
        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();
        }
Пример #11
0
        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();
        }
Пример #13
0
        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();
        }
Пример #14
0
        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();
        }
Пример #15
0
        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();
        }
Пример #16
0
        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();
        }
Пример #17
0
        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();
        }
Пример #18
0
        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();
        }
Пример #19
0
        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;
        }
Пример #20
0
		public void Setup()
		{
			_test = TestFactory.ForHandler<A>()
				.InLocalRemoteBusScenario()
				.New(x =>
					{
						x.Send(new A());
						x.Send(new B());
					});

			_test.Execute();
		}