コード例 #1
0
        public void TestRemoveBySubjectPredicateRemoveAllMatches()
        {
            var c = new TripleCollection();

            c.AddRange(new [] { T1, T5 });
            Assert.AreEqual(2, c.Count());
            c.RemoveBySubjectPredicate("http://example.org/s", "http://example.org/p1");
            Assert.AreEqual(1, c.Count());
            Assert.IsTrue(c.Items.Any(x => x.Equals(T1)));
        }
コード例 #2
0
        public void TestRemoveBySubjectRemovesAllMatches()
        {
            var c = new TripleCollection();

            c.AddRange(new [] { T1, T2, T3, T4 });
            Assert.AreEqual(4, c.Count());
            c.RemoveBySubject("http://example.org/s");
            Assert.AreEqual(1, c.Count());
            Assert.IsTrue(c.Items.Any(x => x.Equals(T4)));
        }
コード例 #3
0
        public void TestAddUpdatesCollection()
        {
            var c = new TripleCollection();

            c.Add(T1);
            Assert.AreEqual(1, c.Count());
            Assert.IsTrue(c.Items.Any(x => x.Equals(T1)));
        }
コード例 #4
0
        public void TestRemoveByObjectDoesNotRemoveLiteralMatches()
        {
            var c = new TripleCollection();

            c.AddRange(new[] { T2, T3 });
            c.RemoveByObject("http://example.org/o");
            Assert.AreEqual(1, c.Count());
            Assert.IsTrue(c.Items.Any(x => x.Equals(T3)));
        }
コード例 #5
0
        public void TestRemoveBySubjectPredicateLiteralDoesNotRemoveUriMatches()
        {
            var c = new TripleCollection();

            c.AddRange(new[] { T2, T3 });
            c.RemoveBySubjectPredicateLiteral("http://example.org/s", "http://example.org/p", "http://example.org/o", RdfDatatypes.String, null);
            Assert.AreEqual(1, c.Count());
            Assert.IsTrue(c.Items.Any(x => x.Equals(T2)));
        }
コード例 #6
0
        public void TestAddRangeUpdatesCollection()
        {
            var c = new TripleCollection();

            c.AddRange(new [] { T1, T2, T3 });
            Assert.AreEqual(3, c.Count());
            Assert.IsTrue(c.Items.Any(x => x.Equals(T1)));
            Assert.IsTrue(c.Items.Any(x => x.Equals(T2)));
            Assert.IsTrue(c.Items.Any(x => x.Equals(T3)));
        }