private IEnumerable <Location> GetAllLocations() { using (var context = _dataContextFactory.Create()) { return(context.Locations .ToList()); } }
private void SetUp() { _factory = Substitute.For <ILocationContextFactory>(); _context = Substitute.For <ILocationContext>(); _factory.Create().Returns(_context); }