Esempio n. 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;
		}
Esempio n. 2
0
        static double msEFSelectRowsWebAPI()
        {
            DateTime start = DateTime.Now;

            var ht = new HandlerTest("http://localhost/api/");

            var list = ht.Get(true);

            return(DateTime.Now.Subtract(start).TotalSeconds);
        }
Esempio n. 3
0
		public void Setup()
		{
			_test = TestFactory.ForHandler<A>()
				.New(x =>
					{
						x.Send(new A());
						x.Send(new B());
					});

			_test.Execute();
		}
Esempio n. 4
0
        public void Setup()
        {
            _test = TestFactory.ForHandler <A>()
                    .New(x =>
            {
                x.Send(new A());
                x.Send(new B());
            });

            _test.Execute();
        }
Esempio n. 5
0
        public void Setup()
        {
            _test = TestFactory.ForHandler <A>()
                    .InLocalRemoteBusScenario()
                    .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();
        }
Esempio n. 8
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();
		}
Esempio n. 9
0
		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.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();
        }
Esempio n. 13
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 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();
        }
Esempio n. 15
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();
        }
Esempio n. 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();
        }
Esempio n. 17
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();
        }
Esempio n. 18
0
    public static void TestSignal1()
    {
        HandlerTest  ht  = new HandlerTest();
        Signal <int> sig = new Signal <int>();

        sig.connect(ht.testHandle1);
        sig.connect(ht.testHandle2);
        sig.connect(ht.testHandle3);
        sig.emit(1337);
        sig.connect(ht.testHandle1);
        //sig.connect(ht.testHandle2);
        sig += ht.testHandle2;
        sig.emit(4499);

        Signal sig0 = new Signal();

        sig0.connect(ht.testHandle0);
        sig0.emit();
    }
Esempio n. 19
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();
        }
Esempio n. 20
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();
        }
Esempio n. 21
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;
        }
Esempio n. 22
0
 public void Teardown()
 {
     _test.Dispose();
     _test = null;
 }
Esempio n. 23
0
 public void Teardown()
 {
     _test.Dispose();
     _test = null;
 }
Esempio n. 24
0
		public void Setup()
		{
			_test = TestFactory.ForHandler<A>()
				.InLocalRemoteBusScenario()
				.New(x =>
					{
						x.Send(new A());
						x.Send(new B());
					});

			_test.Execute();
		}
Esempio n. 25
0
        static void Main(string[] args)
        {
            TestAbstractFactory testAbstractFactory = new TestAbstractFactory();

            testAbstractFactory.Test();

            TestContinentFactory testContinentFactory = new TestContinentFactory();

            testContinentFactory.Test();

            BuilderTest builderTest = new BuilderTest();

            builderTest.Test();

            ShopTest shopTest = new ShopTest();

            shopTest.Test();

            FactoryTest factoryTest = new FactoryTest();

            factoryTest.Test();

            PageFactoryTest pageFactoryTest = new PageFactoryTest();

            pageFactoryTest.Test();

            PrototypeTest prototypeTest = new PrototypeTest();

            prototypeTest.Test();

            ColorPrototypeTest colorPrototypeTest = new ColorPrototypeTest();

            colorPrototypeTest.Test();

            SingletonTest singletonTest = new SingletonTest();

            singletonTest.Test();

            LoadBalancerTest loadBalancerTest = new LoadBalancerTest();

            loadBalancerTest.Test();

            AdapterTest adapterTest = new AdapterTest();

            adapterTest.Test();

            CompoundTest compoundTest = new CompoundTest();

            compoundTest.Test();

            BridgeTest bridgeTest = new BridgeTest();

            bridgeTest.Test();

            CustomersTest customersTest = new CustomersTest();

            customersTest.Test();

            ComponentTest componentTest = new ComponentTest();

            componentTest.Test();

            DrawingElementTest drawingElementTest = new DrawingElementTest();

            drawingElementTest.Test();

            AbstractComponentTest abstractComponentTest = new AbstractComponentTest();

            abstractComponentTest.Test();

            LibraryItemTest libraryItemTest = new LibraryItemTest();

            libraryItemTest.Test();

            FacadeTest facadeTest = new FacadeTest();

            facadeTest.Test();

            MortgageTest mortgageTest = new MortgageTest();

            mortgageTest.Test();

            FlyweightFactoryTest flyweightFactoryTest = new FlyweightFactoryTest();

            flyweightFactoryTest.Test();

            HandlerTest handlerTest = new HandlerTest();

            handlerTest.Test();

            ApproverTest approverTest = new ApproverTest();

            approverTest.Test();

            CommandTest commandTest = new CommandTest();

            commandTest.Test();

            UserTest userTest = new UserTest();

            userTest.Test();

            Console.ReadKey();
        }