[Fact]
public async Task Test_GetCustomer_Status_When_No_Customer_Exist()
{
var customerEngine = A.Fake<ICustomerEngine>();
var monitorEngine = A.Fake<IMonitorEngine>();
var customerLog = A.Fake<ILogProvider<CustomerManager>>();
var conditions = new List<ScanCondition>();
var customers = new List<Customer>();
var names = new List<string>
{
"SERVICE"
};
var hashKey = "SITE";
A.CallTo(() => customerEngine.GetCustomers(conditions)).Returns(null); // Get customers returns AsyncSearch<Customer>
A.CallTo(() => monitorEngine.QueryItems(hashKey, QueryOperator.BeginsWith, names)).Returns(null);
CustomerManager manager = new CustomerManager(customerEngine, monitorEngine);
await manager.GetCustomers();
A.CallTo(() => customerEngine.GetCustomers(A<List<ScanCondition>>.Ignored)).MustHaveHappened();
}
Получить клиентов возвращает AsyncSearch
Но как имитировать AsyncSearch? Есть ли какой-нибудь способ обойти это сейчас?