public async Task TestGetAllSms() { SMS[] sms = { new SMS { Id = new Guid() }, new SMS{ Id = new Guid() } }; Mock <ISmsRepository> mock = new Mock <ISmsRepository>(); SmsController controller = new SmsController(mock.Object); mock.Setup(t => t.Get( It.IsAny <Expression <Func <SMS, bool> > >(), It.IsAny <Func <IQueryable <SMS>, IOrderedQueryable <SMS> > >(), It.IsAny <string>())).ReturnsAsync(sms); IEnumerable <SMS> found = await controller.GetAllSms(); Assert.AreEqual(2, found.Count()); }