public async Task GetTransactionByToId()
        {
            var svc = new DatabaseTransactions(new SqliteInMemoryDatabase());

            var now = DateTime.UtcNow;

            await CreateTestTransactions(now, svc);

            var tsx = await(svc.GetTransactions(toId: 0)).OrderBy(a => a.Instant).ToArrayAsync();

            Assert.AreEqual(1, tsx.Length);
            Assert.AreEqual("test", tsx[0].Unit);
        }
        public async Task GetTransactionByBefore()
        {
            var svc = new DatabaseTransactions(new SqliteInMemoryDatabase());

            var now = DateTime.UtcNow;

            await CreateTestTransactions(now, svc);

            var tsx = await(svc.GetTransactions(before: now + TimeSpan.FromMinutes(2.5))).OrderBy(a => a.Instant).ToArrayAsync();

            Assert.AreEqual(2, tsx.Length);
            Assert.AreEqual("test", tsx[0].Unit);
            Assert.AreEqual("test", tsx[1].Unit);
        }
        public async Task DenyPendingTransaction()
        {
            var db      = new SqliteInMemoryDatabase();
            var tsx     = new DatabaseTransactions(db);
            var pending = new DatabasePendingTransactions(db, tsx);

            var now = DateTime.UtcNow;

            var(a, b, c, d) = await CreateTestTransactions(now, pending);

            var transactionsBefore = await(tsx.GetTransactions(0, 1, "TEST")).ToArrayAsync();

            Assert.AreEqual(0, transactionsBefore.Length);

            Assert.AreEqual(DenyResult.Denied, await pending.DenyPending(a));

            var notConfirmed = await(pending.Get(state: PendingState.Pending)).ToArrayAsync();

            Assert.AreEqual(3, notConfirmed.Length);

            var transactionsAfter = await(tsx.GetTransactions(0, 1, "TEST")).ToArrayAsync();

            Assert.AreEqual(0, transactionsAfter.Length);
        }