Esempio n. 1
0
        public async Task TestGetAndUpsertNonExistentRecordReturnsNull()
        {
            Poco?res = await PocoView.GetAndUpsertAsync(null, GetPoco(2, "2"));

            Assert.IsNull(res);
            Assert.AreEqual("2", (await PocoView.GetAsync(null, GetPoco(2))) !.Val);
        }
Esempio n. 2
0
        public async Task TestGetAndUpsertExistingRecordOverwritesAndReturns()
        {
            await PocoView.UpsertAsync(null, GetPoco(2, "2"));

            Poco?res = await PocoView.GetAndUpsertAsync(null, GetPoco(2, "22"));

            Assert.IsNotNull(res);
            Assert.AreEqual(2, res !.Key);
            Assert.AreEqual("2", res.Val);
            Assert.AreEqual("22", (await PocoView.GetAsync(null, GetPoco(2))) !.Val);
        }