I have an api service that calls another api service. When I set up the Mock objects, it failed with an error:
NotSupportedException: expression refer
You have:
_mockCarrierService = new Mock>>();
So you mock IEnumerable<>. The only member IEnumerable<> has is a method GetEnumerator() (plus another method with the same signature GetEnumerator() inherited from the base interface). The Select method is really an extension method (as was pointed out in the first answer) which is a static method that works by calling GetEnumerator() (possibly through C# foreach statement).
It is possible to make things work by doing Setup of GetEnumerator on your mock.
However, it is much simpler to simply use a concrete, non-mock type which "is" IEnumerable<>, such as List<>. So try:
_mockCarrierService = new List>();
Then add an entry to the List<>. What you should add, is a Mock on which GetFromApiWithQuery Method is setup.