Exemplo n.º 1
0
        private static void ListDemo(IBucket bucket)
        {
            //var pizzaPlaces = new List<PizzaPlace>();
            var pizzaPlaces = new CouchbaseList <PizzaPlace>(bucket, "List_PizzaPlaces");

            pizzaPlaces.Clear();

            pizzaPlaces.Add(new PizzaPlace {
                Name = "Tammy's Pizza", Rating = 5, Delivery = false
            });
            pizzaPlaces.Add(new PizzaPlace {
                Name = "Flyer's", Rating = 3, Delivery = true
            });

            foreach (var pizzaPlace in pizzaPlaces)
            {
                Console.WriteLine(pizzaPlace.Name);
            }
            Console.WriteLine();

            pizzaPlaces.Add(new PizzaPlace {
                Name = "Reggio", Rating = 4, Delivery = false
            });

            foreach (var pizzaPlace in pizzaPlaces)
            {
                Console.WriteLine(pizzaPlace.Name);
            }
        }
        public void Test_Clear()
        {
            var collection = new CouchbaseList<Poco>(_bucket, "BucketListTests_Test_Clear");

            collection.Add(new Poco { Key = "poco2", Name = "Poco-pica" });
            collection.Clear();

            var count = collection.Count;
            Assert.AreEqual(0, count);
        }
Exemplo n.º 3
0
        public void Test_Clear()
        {
            var collection = new CouchbaseList <Poco>(_bucket, "BucketListTests_Test_Clear");

            collection.Add(new Poco {
                Key = "poco2", Name = "Poco-pica"
            });
            collection.Clear();

            var count = collection.Count;

            Assert.AreEqual(0, count);
        }