コード例 #1
0
        public async Task GetBalances19()
        {
            var svc = new DatabaseTransactions(new SqliteInMemoryDatabase());

            var now = DateTime.UtcNow;

            await CreateTestTransactions(now, svc);

            var balances = (await svc.GetBalances(1, null)).ToArray();

            Assert.AreEqual(3, balances.Length);

            //1 -> 0 == -5 TEST
            //1 -> 0 == -1 TEST2
            //1 -> 2 == 5 TEST3

            Assert.AreEqual(-5, balances[0].Amount);
            Assert.AreEqual("test", balances[0].Unit);

            Assert.AreEqual(-1, balances[1].Amount);
            Assert.AreEqual("test2", balances[1].Unit);

            Assert.AreEqual(5, balances[2].Amount);
            Assert.AreEqual("test3", balances[2].Unit);
        }
コード例 #2
0
        public async Task GetBalances10()
        {
            var svc = new DatabaseTransactions(new SqliteInMemoryDatabase());

            var now = DateTime.UtcNow;

            await CreateTestTransactions(now, svc);

            var balances = (await svc.GetBalances(1, 0)).ToArray();

            Assert.AreEqual(2, balances.Length);
        }