测试CreatePostIndex函数
(t *testing.T)
| 44 | |
| 45 | // 测试CreatePostIndex函数 |
| 46 | func TestCreatePostIndex(t *testing.T) { |
| 47 | searchDAO := dao.NewSearchDAO(createMockElasticsearchClient(), createMockLogger()) |
| 48 | err := searchDAO.CreatePostIndex(context.Background()) |
| 49 | if err != nil { |
| 50 | t.Errorf("CreatePostIndex failed: %v", err) |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | // 测试SearchPosts函数 |
| 55 | func TestSearchPosts(t *testing.T) { |
nothing calls this directly
no test coverage detected