Exemplo n.º 1
0
        public void Comparison_two_nodes()
        {
            _ctx.RunScenario <TwoConnectedNodes>();
            var result = _ctx.RunStatement("MATCH (p:Person)-[:LIVES]->(a) RETURN p, a").ToList();

            result.Render(_stmntStorage.Sink);
            var zipRecordsForComparison = result.Zip(_stmntStorage.ProduceDryResult(), (real, dry) => (real, dry));

            void AssertValues(string key, ValueTuple <IRecord, IRecord> nodes, string label)
            {
                var(real, dry) = nodes;
                dry.Keys.SequenceEqual(real.Keys).ShouldBeTrue();
                var dryNode  = dry[key].As <INode>();
                var realNode = real[key].As <INode>();

                dryNode.Id.ShouldBe(realNode.Id);
                dryNode.Properties["name"].ShouldBe(realNode.Properties["name"]);
                dryNode.Labels.ShouldContain(label);
            }

            foreach (var pair in zipRecordsForComparison)
            {
                AssertValues("p", pair, "Person");
                AssertValues("a", pair, "City");
            }
        }
Exemplo n.º 2
0
        public void RunAScenario()
        {
            var idOfNode = _ctx.RunScenario <OneReasonablyComplexNode>().IdOfNode;

            Assert.NotEqual(0, idOfNode);
        }