I've a method like this one:
public IEnumerable<string> GetCompaniesCities()
{
return CompanyRepository.All()
.OrderBy(c => c.City)
.Select(c => c.City.ToUpper())
.Distinct().ToList();
}
How can I test (using moq) that OrderBy (c => c.City)
is called? And Select(c => c.City.ToUpper()
and Distinct()
?
I'm getting
Invalid verify on a non-virtual (overridable in VB) member: x => x.All().OrderBy(c => c.City)
Note: It's a unit test, not an integration test, so I'm not going to the db