Ejemplo n.º 1
0
        public void SetsCustomHeader_WhenUsingANonReturnTypeQuery()
        {
            const string headerName    = "HeaderName";
            const string headerValue   = "TestHeaderValue";
            var          customHeaders = new Neo4jClient.NameValueCollection();

            customHeaders.Add(headerName, headerValue);

            var client = Substitute.For <IRawGraphClient>();
            var query  = new CypherFluentQuery(client)
                         .CustomHeaders(customHeaders)
                         .Match("n")
                         .Set("n.Value = 'value'")
                         .Query;

            Assert.Equal(customHeaders, query.CustomHeaders);
        }
Ejemplo n.º 2
0
        public void SetsMaxExecutionTimeAndCustomHeader_WhenUsingAReturnTypeQuery()
        {
            const string headerName    = "HeaderName";
            const string headerValue   = "TestHeaderValue";
            var          client        = Substitute.For <IRawGraphClient>();
            var          customHeaders = new Neo4jClient.NameValueCollection();

            customHeaders.Add(headerName, headerValue);

            var query = new CypherFluentQuery(client)
                        .MaxExecutionTime(100)
                        .CustomHeaders(customHeaders)
                        .Match("n")
                        .Return <object>("n")
                        .Query;

            Assert.Equal(100, query.MaxExecutionTime);
            Assert.Equal(customHeaders, query.CustomHeaders);
        }