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 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)); } }
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); } }
public IEnumerable <Node <TNode> > LookupIndex <TNode>(string exactIndexName, IndexFor indexFor, string indexKey, int id) { throw new InvalidOperationException(NotValidForBolt); }
public IEnumerable <Node <TNode> > QueryIndex <TNode>(string indexName, IndexFor indexFor, string query) { throw new InvalidOperationException(NotValidForBolt); }
public void DeleteIndex(string indexName, IndexFor indexFor) { throw new InvalidOperationException(NotValidForBolt); }
public void CreateIndex(string indexName, IndexConfiguration config, IndexFor indexFor) { throw new InvalidOperationException(NotValidForBolt); }
public bool CheckIndexExists(string indexName, IndexFor indexFor) { throw new InvalidOperationException(NotValidForBolt); }
public Dictionary <string, IndexMetaData> GetIndexes(IndexFor indexFor) { throw new InvalidOperationException(NotValidForBolt); }
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)); } }