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; }
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); }
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 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(); }
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.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 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(); }
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 Teardown() { _test.Dispose(); _test = null; }
public void Setup() { _test = TestFactory.ForHandler<A>() .InLocalRemoteBusScenario() .New(x => { x.Send(new A()); x.Send(new B()); }); _test.Execute(); }
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(); }