Exemplo n.º 1
0
        public void Setup()
        {
            // Need to use NSubstitute to sub in our dbContext.
            // To seed the data, we need to set the return to an IQueryable.
            _context = Substitute.For <IPizzaDbContext>();
            IQueryable <Pizza> newPizzas = new List <Pizza>()
            {
                new MargaritaPizza(),
                new VegetarianPizza()
            }
            .AsQueryable();

            _context.Pizzas.Returns(newPizzas);
        }
Exemplo n.º 2
0
 public PizzaRepository(IPizzaDbContext context)
 {
     _context = context;
 }