Пример #1
0
        public void Should_create_a_proxy_for_the_interface()
        {
            var            user      = new UserImpl("Chris", "*****@*****.**");
            ComplaintAdded complaint = new ComplaintAddedImpl(user, "No toilet paper", BusinessArea.Appearance)
            {
                Body = "There was no toilet paper in the stall, forcing me to use my treasured issue of .NET Developer magazine."
            };

            TestSerialization(complaint);
        }
Пример #2
0
		public void Should_create_a_proxy_for_the_interface()
		{
			var user = new UserImpl("Chris", "*****@*****.**");
			ComplaintAdded complaint = new ComplaintAddedImpl(user, "No toilet paper", BusinessArea.Appearance)
				{
					Body = "There was no toilet paper in the stall, forcing me to use my treasured issue of .NET Developer magazine."
				};

			TestSerialization(complaint);
		}
Пример #3
0
        public void Should_dispatch_an_interface_via_the_pipeline()
        {
            var pipeline = InboundPipelineConfigurator.CreateDefault(null);

            var consumer = new TestMessageConsumer <ComplaintAdded>();

            pipeline.ConnectInstance(consumer);

            var            user      = new UserImpl("Chris", "*****@*****.**");
            ComplaintAdded complaint = new ComplaintAddedImpl(user, "No toilet paper", BusinessArea.Appearance)
            {
                Body = "There was no toilet paper in the stall, forcing me to use my treasured issue of .NET Developer magazine."
            };

            pipeline.Dispatch(complaint);

            consumer.ShouldHaveReceivedMessage(complaint);
        }
Пример #4
0
		public async Task Should_dispatch_an_interface_via_the_pipeline()
		{
		    IConsumePipe pipe = new ConsumePipeBuilder().Build();

		    var consumer = new MultiTestConsumer(TestTimeout);
		    consumer.Consume<ComplaintAdded>();

		    consumer.Connect(pipe);

			var user = new UserImpl("Chris", "*****@*****.**");
			ComplaintAdded complaint = new ComplaintAddedImpl(user, "No toilet paper", BusinessArea.Appearance)
				{
					Body = "There was no toilet paper in the stall, forcing me to use my treasured issue of .NET Developer magazine."
				};


			await pipe.Send(new TestConsumeContext<ComplaintAdded>(complaint));

		    consumer.Received.Select<ComplaintAdded>().Any().ShouldBe(true);
		}
Пример #5
0
        public async Task Should_dispatch_an_interface_via_the_pipeline()
        {
            var pipe = new ConsumePipeBuilder().Build();

            var consumer = new MultiTestConsumer(TestTimeout);

            consumer.Consume <ComplaintAdded>();

            consumer.Connect(pipe);

            var            user      = new UserImpl("Chris", "*****@*****.**");
            ComplaintAdded complaint = new ComplaintAddedImpl(user, "No toilet paper", BusinessArea.Appearance)
            {
                Body = "There was no toilet paper in the stall, forcing me to use my treasured issue of .NET Developer magazine."
            };


            await pipe.Send(new TestConsumeContext <ComplaintAdded>(complaint));

            consumer.Received.Select <ComplaintAdded>().Any().ShouldBe(true);
        }
Пример #6
0
        public void Should_dispatch_an_interface_via_the_pipeline()
        {
            var builder  = MockRepository.GenerateMock <IObjectBuilder>();
            var pipeline = MessagePipelineConfigurator.CreateDefault(builder, null);

            var consumer = new TestMessageConsumer <ComplaintAdded>();

            var unsubscribeAction = pipeline.Subscribe(consumer);

            var            user      = new UserImpl("Chris", "*****@*****.**");
            ComplaintAdded complaint = new ComplaintAddedImpl(user, "No toilet paper", BusinessArea.Appearance)
            {
                Body = "There was no toilet paper in the stall, forcing me to use my treasured issue of .NET Developer magazine."
            };

            pipeline.Dispatch(complaint);

            PipelineViewer.Trace(pipeline);

            consumer.ShouldHaveReceivedMessage(complaint);
        }
Пример #7
0
		public void Should_dispatch_an_interface_via_the_pipeline()
		{
			var builder = MockRepository.GenerateMock<IObjectBuilder>();
			var pipeline = MessagePipelineConfigurator.CreateDefault(builder, null);

			var consumer = new TestMessageConsumer<ComplaintAdded>();

			var unsubscribeAction = pipeline.Subscribe(consumer);

			var user = new UserImpl("Chris", "*****@*****.**");
			ComplaintAdded complaint = new ComplaintAddedImpl(user, "No toilet paper", BusinessArea.Appearance)
				{
					Body = "There was no toilet paper in the stall, forcing me to use my treasured issue of .NET Developer magazine."
				};

			pipeline.Dispatch(complaint);

			PipelineViewer.Trace(pipeline);

			consumer.ShouldHaveReceivedMessage(complaint);
		}