Esempio n. 1
0
    static async Task <IEndpointInstance> StartEndpoint(ManualResetEvent resetEvent)
    {
        var configuration = await EndpointCreator.Create(nameof(HttpPassthroughIntegrationTests));

        var attachments = configuration.EnableAttachments(async() => await Connection.OpenAsyncConnection(), TimeToKeep.Default);

        configuration.RegisterComponents(components => components.RegisterSingleton(resetEvent));
        attachments.UseTransportConnectivity();
        return(await Endpoint.Start(configuration));
    }
        public void Should_throw_meaningful_exception()
        {
            var endpointConfiguration = new EndpointConfiguration("myendpoint");

            endpointConfiguration.TypesToScanInternal(new[] { typeof(FeatureWithInitialization) });

            var ae       = Assert.Throws <Exception>(() => EndpointCreator.CreateWithInternallyManagedContainer(endpointConfiguration));
            var expected = $"Unable to create the type '{nameof(FeatureWithInitialization)}'. Types implementing '{nameof(INeedInitialization)}' must have a public parameterless (default) constructor.";

            Assert.AreEqual(expected, ae.Message);
        }
Esempio n. 3
0
    public async Task Run()
    {
        var resetEvent    = new ManualResetEvent(false);
        var configuration = await EndpointCreator.Create("IntegrationSend");

        configuration.RegisterComponents(components => components.RegisterSingleton(resetEvent));
        var endpoint = await Endpoint.Start(configuration);

        await SendStartMessage();

        resetEvent.WaitOne();
        await endpoint.Stop();
    }
Esempio n. 4
0
    public async Task Run()
    {
        await SqlConnection.DropTable(null, table);

        var manager = new QueueManager(table, SqlConnection);
        await manager.Create();

        var configuration = await EndpointCreator.Create("IntegrationConsumer");

        configuration.SendOnly();
        var endpoint = await Endpoint.Start(configuration);

        await SendStartMessage(endpoint);

        var consumer = new QueueManager(table, SqlConnection);

        await using var message = await consumer.Consume();

        Assert.NotNull(message);
    }
    static async Task <IEndpointInstance> StartEndpoint()
    {
        var configuration = await EndpointCreator.Create(nameof(HttpPassthroughDedupTests));

        return(await Endpoint.Start(configuration));
    }