Esempio n. 1
0
        public void testBigGraphWithNoEdges()
        {
            var _Graph = TinkerGraphFactory.CreateTinkerGraph();

            for (var i = 0; i < 100000; i++)
                _Graph.AddVertex();

            var _Vertices = new AllVerticesPipe<UInt64, Int64, String, String, Object,
                                                UInt64, Int64, String, String, Object,
                                                UInt64, Int64, String, String, Object,
                                                UInt64, Int64, String, String, Object>();

            _Vertices.SetSource(new SingleEnumerator<IGenericPropertyGraph<UInt64, Int64, String, String, Object,
                                                                           UInt64, Int64, String, String, Object,
                                                                           UInt64, Int64, String, String, Object,
                                                                           UInt64, Int64, String, String, Object>>(_Graph));

            var _OutEdges = new OutEdgesPipe<UInt64, Int64, String, String, Object,
                                             UInt64, Int64, String, String, Object,
                                             UInt64, Int64, String, String, Object,
                                             UInt64, Int64, String, String, Object>();

            _OutEdges.SetSource(_Vertices);

            var _Counter = 0;
            while (_OutEdges.MoveNext())
                _Counter++;

            Assert.AreEqual(0, _Counter);
        }
Esempio n. 2
0
        public void testVertexIterator()
        {
            var _Graph = TinkerGraphFactory.CreateTinkerGraph();
            var _Pipe = new AllVerticesPipe<UInt64, Int64, String, String, Object,
                                            UInt64, Int64, String, String, Object,
                                            UInt64, Int64, String, String, Object,
                                            UInt64, Int64, String, String, Object>();

            _Pipe.SetSource(new SingleEnumerator<IGenericPropertyGraph<UInt64, Int64, String, String, Object,
                                                                       UInt64, Int64, String, String, Object,
                                                                       UInt64, Int64, String, String, Object,
                                                                       UInt64, Int64, String, String, Object>>(_Graph));

            var _Counter = 0;
            var _Vertices = new HashSet<IReadOnlyGenericPropertyVertex<UInt64, Int64, String, String, Object,
                                                                       UInt64, Int64, String, String, Object,
                                                                       UInt64, Int64, String, String, Object,
                                                                       UInt64, Int64, String, String, Object>>();

            while (_Pipe.MoveNext())
            {
                _Counter++;
                var _Vertex = _Pipe.Current;
                _Vertices.Add(_Vertex);
            }

            Assert.AreEqual(6, _Counter);
            Assert.AreEqual(6, _Vertices.Count);
        }