public void Test_Add()
        {
            var collection = new CouchbaseSet<Poco>(_bucket, "CouchbaseSetTests_Test_Add");
            collection.Clear();

            collection.Add(new Poco {Key = "poco1", Name = "Poco-pica"});
            collection.Add(new Poco {Key = "poco2", Name = "Poco-pica2"});
        }
Exemplo n.º 2
0
        public void Test_Add()
        {
            var collection = new CouchbaseSet <Poco>(_bucket, "CouchbaseSetTests_Test_Add");

            collection.Clear();

            collection.Add(new Poco {
                Key = "poco1", Name = "Poco-pica"
            });
            collection.Add(new Poco {
                Key = "poco2", Name = "Poco-pica2"
            });
        }
Exemplo n.º 3
0
        public void Test_Add_WhenExists_ThrowInvalidOperationException()
        {
            var collection = new CouchbaseSet <Poco>(_bucket, "Test_Add_WhenExists_ThrowInvalidOPerationException");

            collection.Clear();

            collection.Add(new Poco {
                Key = "poco1", Name = "Poco-pica"
            });
            Assert.Throws <InvalidOperationException>(() => collection.Add(new Poco {
                Key = "poco1", Name = "Poco-pica"
            }));
        }
        public void Test_Clear()
        {
            var collection = new CouchbaseSet<Poco>(_bucket, "CouchbaseSetTests_Test_Clear");
            collection.Add(new Poco { Key = "poco1", Name = "Poco-pica" });
            collection.Clear();

            Assert.AreEqual(0, collection.Count);
        }
        public void Test_Remove()
        {
            var collection = new CouchbaseSet<Poco>(_bucket, "CouchbaseSetTests_Test_Clear");
            collection.Add(new Poco { Key = "poco1", Name = "Poco-pica" });
            collection.Remove(new Poco {Key = "poco1", Name = "Poco-pica"});

            var actual = collection.Contains(new Poco {Key = "poco1", Name = "Poco-pica"});

            Assert.AreEqual(false, actual);
        }
Exemplo n.º 6
0
        public void Test_Clear()
        {
            var collection = new CouchbaseSet <Poco>(_bucket, "CouchbaseSetTests_Test_Clear");

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

            Assert.AreEqual(0, collection.Count);
        }
Exemplo n.º 7
0
        public void Test_Remove()
        {
            var collection = new CouchbaseSet <Poco>(_bucket, "CouchbaseSetTests_Test_Clear");

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

            var actual = collection.Contains(new Poco {
                Key = "poco1", Name = "Poco-pica"
            });

            Assert.AreEqual(false, actual);
        }
        public void Test_Add_WhenExists_ThrowInvalidOperationException()
        {
            var collection = new CouchbaseSet<Poco>(_bucket, "Test_Add_WhenExists_ThrowInvalidOPerationException");
            collection.Clear();

            collection.Add(new Poco {Key = "poco1", Name = "Poco-pica"});
            Assert.Throws<InvalidOperationException>(() => collection.Add(new Poco { Key = "poco1", Name = "Poco-pica" }));
        }