コード例 #1
0
        public void CheckInsert_NewData_RetrunOk()
        {
            ElasticInputModel input = new ElasticInputModel
            {
                DomainName = "Domain for Test",
                RequestId  = Guid.NewGuid(),
                SessionId  = 11111,
                Status     = 1,
                Data       = new List <ElasticDataModel> {
                    new ElasticDataModel
                    {
                        Images = new List <string> {
                            "image1", "image2"
                        },
                        Icons = new List <string> {
                            "icon1", "icon2"
                        },
                        Videos = new List <string> {
                            "videos1", "video2"
                        },
                        Texts = new List <string> {
                            "text1", "text2"
                        }
                    }
                }
            };
            var before_count = _elasticSearch.TotalDataCount();

            _elasticSearch.AddNewIndex(input);

            var after_count    = _elasticSearch.TotalDataCount();
            int increate_count = after_count - before_count;

            Assert.Equal(1, increate_count);
        }