# How to mock an index?

**URL:** <https://discuss.elastic.co/t/how-to-mock-an-index/315580>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [September 30, 2022, 2:34pm UTC](https://discuss.elastic.co/t/how-to-mock-an-index/315580 "2022-09-30T14:34:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sajidb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sajidb/32/111548_2.png) [@sajidb](https://discuss.elastic.co/u/sajidb)\
**Post date:** [September 30, 2022, 2:34pm UTC](https://discuss.elastic.co/t/how-to-mock-an-index/315580/1 "2022-09-30T14:34:12Z")

</div>

I want to create an integration test in C#10 (.NET 6) that does some tests on the Elasticsearch index but I can't do it with the real data. I want to mock an index or create an index with dummy data and then test it by giving mock inputs and expecting results.  
The index will be for the testing purposes that's why either mocking or creating a dummy will work.

---

<div class="post-metadata">

**Author:** ![RabBit\_BR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rabbit_br/32/82261_2.png) [@RabBit\_BR](https://discuss.elastic.co/u/RabBit_BR)\
**Post date:** [October 1, 2022, 12:08am UTC](https://discuss.elastic.co/t/how-to-mock-an-index/315580/2 "2022-10-01T00:08:08Z")

</div>

Hi @sajidb .

I use [testcontainer](https://github.com/testcontainers/testcontainers-dotnet) for integrations tests. Maybe help you.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 29, 2022, 12:09am UTC](https://discuss.elastic.co/t/how-to-mock-an-index/315580/3 "2022-10-29T00:09:00Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
