public GraphStoreTests() { var configuration = MockBuilder.BuildConfiguration(); var graphClientFactory = new GraphClientFactory(NeoServerConfiguration.GetConfiguration(new Uri($"{configuration.GraphStore.Url}/db/data"), configuration.GraphStore.Username, configuration.GraphStore.Password)); _graphStore = new GraphStore(graphClientFactory.Create(), false); }
public Parser(ParserFactory parserFactory) { this.parser = parserFactory.Create(); this.store = new DefaultGraphStore(); this.locations = new Dictionary<object, SourceSpan>(); this.parser.GraphBuilder = new NodeGraphBuilder(store); this.parser.SyntaxMatched += new EventHandler<SyntaxMatchedEventArgs>(parser_SyntaxMatched); }
public void InitializeThenGetClientReturnsClient() { var graphStore = new GraphStore("http://localhost:7474/"); graphStore.Initialize(); var client = graphStore.GetClient(); Assert.That(client, Is.InstanceOf <NeoClient>()); }
public void TransactionRollsbackWhenNotScopeComplete() { this.graphStore = new GraphStore("http://localhost:7474/"); this.graphStore.Initialize(); var neoClient = this.graphStore.GetClient(); var randomText = this.RandomString(12); int newId = -1; using (var ts = new TransactionScope()) { var reader = neoClient.QueryAsync("CREATE (n:Person { name:'" + randomText + "' }) RETURN Id(n)").Result; Assert.That(reader.Read(), Is.EqualTo(true)); newId = reader.Get <int>(0); Assert.That(newId, Is.GreaterThan(-1)); } var queryReader = neoClient.QueryAsync("MATCH (n:Person) WHERE n.name ='" + randomText + "' RETURN Id(n)").Result; Assert.That(queryReader.Read(), Is.EqualTo(false)); }
public void CallingGetClientBeforeInitializeThrowsInvalidOperationException() { var graphStore = new GraphStore("http://localhost:7474/"); Assert.Throws <InvalidOperationException>(() => graphStore.GetClient()); }
public void InitialiseThrowsExecptionWithInvalidUrl() { var graphStore = new GraphStore("http://www.google.com/"); Assert.Throws <JsonReaderException>(graphStore.Initialize); }
public void SetupOnce() { this.graphStore = new GraphStore("http://localhost:7474/", new JsonHttpClientWrapper("neo4j", "longbow")); this.graphStore.Initialize(); }