Example #1
0
        public static async Task<(IEndpointInstance, OrderStore)> StartEndpoint(Action<EndpointConfiguration> configure = null)
        {
            var endpointName = "IntegrationTests.Endpoint";
            
            var configuration = new EndpointConfiguration(endpointName);
            
            var transport = configuration.UseTransport<LearningTransport>();
            transport.Routing().RouteToEndpoint(typeof(PlaceOrder), endpointName);

            var orderStore = new OrderStore();
            configuration.RegisterComponents(cc => cc.RegisterSingleton(orderStore));

            configure?.Invoke(configuration);

            var endpoint = await Endpoint.Start(configuration).ConfigureAwait(false);

            return (endpoint, orderStore);
        }
Example #2
0
 public PlaceOrderHandler(OrderStore store)
 {
     this.store = store;
 }