net core api controller unit testing using xunit and moq : <p>i have some api controller methods that i would like to add some unit tests to. I am using xunit and moq and writing in c# using asp net core.</p>

<p>example of one method is:</p>

<pre><code>public async Task&lt;ActionResult&lt;List&lt;StatusDTO&gt;&gt;&gt; Get()
{
    return await _statusservice.GetStatusesAsync();
}
</code></pre>

<p>at this point in time my controller method is simply returning the dto that the service layer method is returning. In future it might change to return a specific viewmodel.</p>

<p>i have read <a href="https://docs.microsoft.com/en-us/aspnet/core/mvc/controllers/testing?view=aspnetcore-2.2" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/core/mvc/controllers/testing?view=aspnetcore-2.2</a> to get some guidance on testing controllers.</p>

<p>My question is : for example above would the unit test just consist of 
- checking that the return type is <code>ActionResult&lt;StatusDTO&gt;</code> and/or (using moq) verifying the service method has been called. </p>

<p>Should i set up my service method to return a mock <code>StatusDTO</code> and do some assertions against that. I don't see benefit of that in this situation, as that would be testing the service method wouldn't it and i would cover that in the service method tests.</p>

<p>Sorry if this seems quite basic - my knowledge and experience in writing unit tests is very limited.
Thanks for any help.</p>
