Esempio n. 1
0
 public void GetLocationsShouldReturnAllLocations()
 {
     using (var context = new Entity.StoreDBContext(options))
     {
         IStoreRepository _repo = new StoreRepoDB(context, new StoreMapper());
         var locations          = _repo.GetLocations();
         Assert.Equal(2, locations.Count);
     }
 }
 public void GetLocationsShouldGetAllLocations()
 {
     using (var ctx = new StoreContext(options))
     {
         StoreRepoDB repo = new StoreRepoDB(ctx);
         for (int i = 0; i < 5; i++)
         {
             Location testLocation = new Location();
             testLocation.LocationName    = $"Test{i}";
             testLocation.LocationAddress = "asdf";
             ctx.Locations.Add(testLocation);
         }
         ctx.SaveChanges();
     }
     using (var assertCtx = new StoreContext(options))
     {
         StoreRepoDB repo      = new StoreRepoDB(assertCtx);
         var         locations = repo.GetLocations(location => true);
         Assert.NotNull(locations);
         Assert.Equal(5, locations.Count);
     }
 }
Esempio n. 3
0
 public List <Location> GetLocations()
 {
     return(repo.GetLocations(loc => true));
 }