Beispiel #1
0
        public void ShouldCreateIndex(
            IndexFor indexFor,
            IndexProvider indexProvider,
            IndexType indexType,
            string createEndpoint,
            string createJson)
        {
            //Arrange
            using (var testHarness = new RestTestHarness
            {
                {
                    MockRequest.PostJson(createEndpoint, createJson),
                    MockResponse.Http(201)
                }
            })
            {
                var graphClient = testHarness.CreateAndConnectGraphClient();

                var indexConfiguration = new IndexConfiguration
                {
                    Provider = indexProvider,
                    Type     = indexType
                };
                graphClient.CreateIndex("foo", indexConfiguration, indexFor);
            }
        }
        public void ShouldCreateIndex(
            IndexFor indexFor,
            IndexProvider indexProvider,
            IndexType indexType,
            string createEndpoint,
            string createJson)
        {
            //Arrange
            using (var testHarness = new RestTestHarness
            {
                {
                    MockRequest.PostJson(createEndpoint, createJson),
                    MockResponse.Http(201)
                }
            })
            {
                var graphClient = testHarness.CreateAndConnectGraphClient();

                var indexConfiguration = new IndexConfiguration
                {
                    Provider = indexProvider,
                    Type = indexType
                };
                graphClient.CreateIndex("foo", indexConfiguration, indexFor);
            }
        }
Beispiel #3
0
        public void ShouldThrowExceptionIfHttpCodeIsNot201(
            IndexFor indexFor,
            IndexProvider indexProvider,
            IndexType indexType,
            string createEndpoint,
            string createJson)
        {
            //Arrange
            using (var testHarness = new RestTestHarness
            {
                {
                    MockRequest.PostJson(createEndpoint, createJson),
                    MockResponse.Http(500)
                }
            })
            {
                var graphClient = testHarness.CreateAndConnectGraphClient();

                var indexConfiguration = new IndexConfiguration
                {
                    Provider = indexProvider,
                    Type     = indexType
                };
                Assert.Throws <Exception>(() => graphClient.CreateIndex("foo", indexConfiguration, indexFor));
            }
        }
Beispiel #4
0
 public bool ShouldReturnIfIndexIsFound(
     IndexFor indexFor,
     string indexPath,
     HttpStatusCode httpStatusCode)
 {
     using (var testHarness = new RestTestHarness
     {
         {
             MockRequest.Get(indexPath),
             MockResponse.Json(httpStatusCode, "")
         }
     })
     {
         var graphClient = testHarness.CreateAndConnectGraphClient();
         return(graphClient.CheckIndexExists("MyIndex", indexFor));
     }
 }
 public bool ShouldReturnIfIndexIsFound(
     IndexFor indexFor,
     string indexPath,
     HttpStatusCode httpStatusCode)
 {
     using (var testHarness = new RestTestHarness
     {
         {
             MockRequest.Get(indexPath),
             MockResponse.Json(httpStatusCode, "")
         }
     })
     {
         var graphClient = testHarness.CreateAndConnectGraphClient();
         return graphClient.CheckIndexExists("MyIndex", indexFor);
     }
 }
Beispiel #6
0
 public IEnumerable <Node <TNode> > LookupIndex <TNode>(string exactIndexName, IndexFor indexFor, string indexKey, int id)
 {
     throw new InvalidOperationException(NotValidForBolt);
 }
Beispiel #7
0
 public IEnumerable <Node <TNode> > QueryIndex <TNode>(string indexName, IndexFor indexFor, string query)
 {
     throw new InvalidOperationException(NotValidForBolt);
 }
Beispiel #8
0
 public void DeleteIndex(string indexName, IndexFor indexFor)
 {
     throw new InvalidOperationException(NotValidForBolt);
 }
Beispiel #9
0
 public void CreateIndex(string indexName, IndexConfiguration config, IndexFor indexFor)
 {
     throw new InvalidOperationException(NotValidForBolt);
 }
Beispiel #10
0
 public bool CheckIndexExists(string indexName, IndexFor indexFor)
 {
     throw new InvalidOperationException(NotValidForBolt);
 }
Beispiel #11
0
 public Dictionary <string, IndexMetaData> GetIndexes(IndexFor indexFor)
 {
     throw new InvalidOperationException(NotValidForBolt);
 }
Beispiel #12
0
        public void ShouldThrowExceptionIfHttpCodeIsNot201(
            IndexFor indexFor,
            IndexProvider indexProvider,
            IndexType indexType,
            string createEndpoint,
            string createJson)
        {
            //Arrange
            using (var testHarness = new RestTestHarness
            {
                {
                    MockRequest.PostJson(createEndpoint, createJson),
                    MockResponse.Http(500)
                }
            })
            {
                var graphClient = testHarness.CreateAndConnectGraphClient();

                var indexConfiguration = new IndexConfiguration
                {
                    Provider = indexProvider,
                    Type = indexType
                };
                Assert.Throws<Exception>(() => graphClient.CreateIndex("foo", indexConfiguration, indexFor));
            }
        }