Exemple #1
0
 public void CanEnumerateSubjects()
 {
     using (var repoFixture = new RepositoryFixture("test-enumerate"))
     {
         repoFixture.Import("data\\test1.nq");
         var testHandler = new TestTripleCollectionHandler(tc =>
         {
             tc.Count.Should().Be(5);
             tc.All(x => x.Subject.Equals(tc[0].Subject)).Should().BeTrue();
         });
         repoFixture.Store.EnumerateSubjects(testHandler);
         testHandler.TotalCount.Should().Be(200);
     }
 }
Exemple #2
0
 public void CanEnumerateSharedObjects()
 {
     using (var repoFixture = new RepositoryFixture("test-enumerate"))
     {
         repoFixture.Import("data\\test2a.nq");
         var testHandler = new TestTripleCollectionHandler(tc =>
         {
             tc.All(x => x.Object.Equals(tc[0].Object)).Should().BeTrue();
             var objectUri = (tc[0].Object as IUriNode)?.Uri?.ToString();
             objectUri.Should().NotBeNull();
             if (objectUri.Equals("http://example.org/o/0"))
             {
                 tc.Count.Should().Be(3);
             }
             if (objectUri.Equals("http://example.org/o/1"))
             {
                 tc.Count.Should().Be(2);
             }
         });
         repoFixture.Store.EnumerateObjects(testHandler);
         testHandler.TotalCount.Should().Be(2);
     }
 }