public async void ShouldGetAllRestaurants() { var options = new DbContextOptionsBuilder <OrderFoodContext>().UseInMemoryDatabase(databaseName: "ShouldGetAllRestaurants").Options; var sortedList = new List <Restaurant>() { new Restaurant() { Name = "Ramzes", Website = "www.ramzes.pl" }, new Restaurant() { Name = "Kebab Hot", Website = "www.kebabhot.pl" }, new Restaurant() { Name = "Muzyczna", Website = "www.muzyczna.pl" } }; using (var context = new OrderFoodContext(options)) { foreach (var game in sortedList) { context.Add(game); context.SaveChanges(); } } // Act IEnumerable <Restaurant> actualList; using (var context = new OrderFoodContext(options)) { var repository = new RestaurantRepository(context); actualList = await repository.GetAll(); } // Assert Assert.Equal(sortedList.Count(), actualList.Count()); }
public ProfileController(OrderFoodContext ctx, IMapper mapper) { _ctx = ctx; _mapper = mapper; }
public SigninController(OrderFoodContext db, IMapper mapper) { _ctx = db; _mapper = mapper; }
public EmployeeController(OrderFoodContext ctx, IMapper mapper) { _ctx = ctx; _mapper = mapper; }
public RestaurantRepository(OrderFoodContext context) { this._context = context ?? throw new ArgumentNullException(nameof(context)); }
public ProductController(OrderFoodContext orderFoodContext, IMapper mapper) { _ctx = orderFoodContext; _mapper = mapper; }
public ShopLeft(OrderFoodContext ctx, IMapper mapper) { _ctx = ctx; _mapper = mapper; }