Exemplo n.º 1
0
        public async Task TestGetAndReplaceNonExistentRecordReturnsNullDoesNotCreateRecord()
        {
            Poco?res = await PocoView.GetAndReplaceAsync(null, GetPoco(1, "1"));

            Assert.IsNull(res);
            Assert.IsNull(await PocoView.GetAsync(null, GetPoco(1)));
        }
Exemplo n.º 2
0
        public async Task TestGetAndReplaceExistingRecordReturnsOldOverwrites()
        {
            await PocoView.UpsertAsync(null, GetPoco(1, "1"));

            Poco?res = await PocoView.GetAndReplaceAsync(null, GetPoco(1, "2"));

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