public async Task Integration()
    {
        await using (var connection = Connection.OpenConnection())
        {
            var manager = new DedupeManager(connection, "Deduplication");
            await manager.Create();
        }

        var endpoint = await StartEndpoint();

        var hostBuilder = new WebHostBuilder();

        hostBuilder.UseStartup <SampleStartup>();
        using (var server = new TestServer(hostBuilder))
        {
            using var client = server.CreateClient();
            client.DefaultRequestHeaders.Referrer = new("http://TheReferrer");
            var clientFormSender = new ClientFormSender(client);
            var guid             = Guid.NewGuid();
            var first            = await SendAsync(clientFormSender, guid);

            Assert.Equal(202, first);
            var second = await SendAsync(clientFormSender, guid);

            Assert.Equal(208, second);
        }

        Thread.Sleep(3000);

        await endpoint.Stop();

        Assert.Equal(1, count);
    }
    async Task CreateTable()
    {
        #region CreateDeduplicationTable

        var manager = new DedupeManager(sqlConnection, "DeduplicationTable");
        await manager.Create();

        #endregion
    }
 public static async Task Run()
 {
     using (var connection = await ConnectionHelpers.OpenConnection(SqlHelper.ConnectionString)
                             .ConfigureAwait(false))
     {
         var dedupeManager = new DedupeManager(connection, "Deduplication");
         await dedupeManager.Create().ConfigureAwait(false);
     }
 }
Beispiel #4
0
    async Task CreateTable()
    {
        #region CreateDeduplicationTable

        var queueManager = new DedupeManager(sqlConnection, "DeduplicationTable");
        await queueManager.Create().ConfigureAwait(false);

        #endregion
    }
    public async Task Install(string identity)
    {
        if (settings == null || settings.InstallerDisabled)
        {
            return;
        }

        using var connection = await settings.ConnectionBuilder(CancellationToken.None);

        var manager = new DedupeManager(connection, settings.Table);
        await manager.Create();
    }
    public async Task Integration()
    {
        await using (var connection = Connection.OpenConnection())
        {
            var manager = new DedupeManager(connection, "Deduplication");
            await manager.Create();

            await Installer.CreateTable(connection, "MessageAttachments");
        }

        var resetEvent = new ManualResetEvent(false);
        var endpoint   = await StartEndpoint(resetEvent);

        await SubmitMultipartForm();

        if (!resetEvent.WaitOne(TimeSpan.FromSeconds(2)))
        {
            throw new("OutgoingMessage not received");
        }

        await endpoint.Stop();
    }