I am trying to write some unit tests against my service which inject the
IContentsClient. So I am using Moq to mock
IContentsClient. However I am not able to stub or fake the result from
GetAsync which is
ContentsResult. I need to use the
Data property to implement my business logic.
The problem is that
Data property in
ContentsResult is readonly so I am not able to stub and fake it.
Is there any other ways to write unit tests against GetAsync method using Moq.