Example #1
0
        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);
        }
Example #2
0
        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;
        }
Example #4
0
 public OrdersController(PandaTeaContext context)
 {
     _context = context;
 }
Example #5
0
 public MenusController(PandaTeaContext context)
 {
     _context = context;
 }