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))); }
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))); }
public void TestAddUpdatesCollection() { var c = new TripleCollection(); c.Add(T1); Assert.AreEqual(1, c.Count()); Assert.IsTrue(c.Items.Any(x => x.Equals(T1))); }
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))); }
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))); }
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))); }