public UnitTest() { var options = new DbContextOptionsBuilder <PandaTeaContext>() .UseInMemoryDatabase(databaseName: "Add_writes_to_database") .Options; context = new PandaTeaContext(options); usersController = new UsersController(context); menusController = new MenusController(context); ordersController = new OrdersController(context); }
public UsersControllerTests(ITestOutputHelper output) { var options = new DbContextOptionsBuilder <PandaTeaContext>() .UseInMemoryDatabase(databaseName: "Add_writes_to_database") .Options; _context = new PandaTeaContext(options); _usersController = new UsersController(_context); this.output = output; }
public OrdersControllerTests() { var options = new DbContextOptionsBuilder <PandaTeaContext>() .UseInMemoryDatabase(databaseName: "Add_writes_to_database") .Options; _context = new PandaTeaContext(options); _ordersController = new OrdersController(_context); this.output = output; //var _context = new Mock<ControllerContext>(); //var _session = new Mock<ISession>(); //_context.Setup(m => m.HttpContext.Session).Returns(_session.Object); //OrdersController oc = new OrdersController(null); //oc.ControllerContext = _context.Object; }
public OrdersController(PandaTeaContext context) { _context = context; }
public MenusController(PandaTeaContext context) { _context = context; }