예제 #1
0
        public async Task AddUnique()
        {
            LCObject book = new LCObject("Book");

            book["pages"] = new List <int> {
                1, 2, 3, 4, 5
            };
            await book.Save();

            // add
            book.AddUnique("pages", 1);
            await book.Save();

            TestContext.WriteLine(book["pages"]);
            Assert.AreEqual((book["pages"] as List <object>).Count, 5);

            book.AddAllUnique("pages", new List <int> {
                5, 6, 7
            });
            await book.Save();

            TestContext.WriteLine(book["pages"]);
            Assert.AreEqual((book["pages"] as List <object>).Count, 7);
        }