예제 #1
0
        [InlineData("ESHealthData/unexpected.json")]   // i.e. "Unexpected color"
        public void GetStatus_Unhealthy(string datafile)
        {
            IOptions <AutosuggestIndexOptions> config = GetMockedAutosuggestIndexOptions();
            AutosuggestController ctrl = new AutosuggestController(
                ElasticTools.GetInMemoryElasticClient(datafile),
                config,
                NullLogger <AutosuggestController> .Instance
                );

            APIErrorException ex = Assert.Throws <APIErrorException>(() => ctrl.GetStatus());

            Assert.Equal(500, ex.HttpStatusCode);
        }
예제 #2
0
        public void GetStatus_Healthy(string datafile)
        {
            IOptions <AutosuggestIndexOptions> config = GetMockedAutosuggestIndexOptions();
            AutosuggestController ctrl = new AutosuggestController(
                ElasticTools.GetInMemoryElasticClient(datafile),
                config,
                NullLogger <AutosuggestController> .Instance
                );

            string status = ctrl.GetStatus();

            Assert.Equal(AutosuggestController.HEALTHY_STATUS, status, ignoreCase: true);
        }