вторник, 28 августа 2012 г.

Mocking collection property with Moq


In this example I will mock OrderService class and setup its Orders property with IQueryable collection of Orders with some default values.

    1var mock = new Mock();
    2mock.SetupGet(f => f.Orders).Returns(new [] { new Order () }.AsQueryable());

Комментариев нет: