예제 #1
0
        public GraphClient CreateGraphClient(Neo4jVersion neoVersion)
        {
            if (!recordedResponses.Keys.Any(r => r.Resource == "" || r.Resource == "/"))
            {
                MockResponse response;
                switch (neoVersion)
                {
                case Neo4jVersion.Neo19:
                    response = MockResponse.NeoRoot();
                    break;

                case Neo4jVersion.Neo20:
                    response = MockResponse.NeoRoot20();
                    break;

                case Neo4jVersion.Neo22:
                    response = MockResponse.NeoRoot(2, 2, 0);
                    break;

                case Neo4jVersion.Neo225:
                    response = MockResponse.NeoRoot(2, 2, 5);
                    break;

                case Neo4jVersion.Neo226:
                    response = MockResponse.NeoRoot(2, 2, 6);
                    break;

                case Neo4jVersion.Neo23:
                    response = MockResponse.NeoRoot(2, 3, 0);
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(neoVersion), neoVersion, null);
                }
                Add(MockRequest.Get(""), response);
            }

            var httpClient = GenerateHttpClient(BaseUri);

            var graphClient = new GraphClient(new Uri(BaseUri), httpClient);

            return(graphClient);
        }
예제 #2
0
 public void Add(MockRequest request, MockResponse response)
 {
     recordedResponses.Add(request, response);
 }
예제 #3
0
 public void Add(MockRequest request, MockResponse response)
 {
     recordedResponses.Add(request, response);
 }