开发者

Creating a Mock DetactedCreteria Object

开发者 https://www.devze.com 2022-12-29 21:41 出处:网络
I have a function in my service layer whose output needs to be mocked. it takes in a FinanceAccount object and returns a List

I have a function in my service layer whose output needs to be mocked.

it takes in a FinanceAccount object and returns a List the function uses the FinanceAccount object to create a DetachtedCreteria. and fetch a List.

How can I SetUp this function so that it returns separate Lists for 3 开发者_如何学运维three different FinanceAccount objects.

I am using Moq.


Found that the design of the service layer being tested was wrong. each part of the servicer layer should have been created with unit tests in mind.rather than refactoring tests after the code was written.

0

精彩评论

暂无评论...
验证码 换一张
取 消