# No interface implementation for SortDescriptor class in NEST client for c#

**URL:** <https://discuss.elastic.co/t/no-interface-implementation-for-sortdescriptor-class-in-nest-client-for-c/163703>\
**Category:** Elasticsearch\
**Created:** [January 10, 2019, 10:26am UTC](https://discuss.elastic.co/t/no-interface-implementation-for-sortdescriptor-class-in-nest-client-for-c/163703 "2019-01-10T10:26:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![navead\_kazi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/navead_kazi/32/39615_2.png) [@navead\_kazi](https://discuss.elastic.co/u/navead_kazi)\
**Post date:** [January 10, 2019, 10:26am UTC](https://discuss.elastic.co/t/no-interface-implementation-for-sortdescriptor-class-in-nest-client-for-c/163703/1 "2019-01-10T10:26:11Z")

</div>

I am using NEST 5.6.5 for my c# client and wanted to write a query with a custom sort algorithm. I am using the below Sort Api

`public SearchDescriptor Sort(Func<SortDescriptor<T> , IPromise<IList<ISort>>> selector);`

I am implementing the `Func` in a separate class with some logic to decide the sort criteria. Since API is passing a concrete`SortDescriptor<T>` I not able to unit test the `Func` and its logic. Is there an Interface that can be used instead of concrete implementation that can be used for unit testing the sort criteria logic code.

---

<div class="post-metadata">

**Author:** ![forloop](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/forloop/32/9021_2.png) [@forloop](https://discuss.elastic.co/u/forloop)\
**Post date:** [January 11, 2019, 11:18am UTC](https://discuss.elastic.co/t/no-interface-implementation-for-sortdescriptor-class-in-nest-client-for-c/163703/2 "2019-01-11T11:18:42Z")

</div>

How are you looking to unit test, on the resultant JSON?

---

<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:** [February 8, 2019, 11:18am UTC](https://discuss.elastic.co/t/no-interface-implementation-for-sortdescriptor-class-in-nest-client-for-c/163703/3 "2019-02-08T11:18:46Z")

</div>

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