Ejemplo n.º 1
0
        public void Setup()
        {
            fakeHttpContextAccessor = A.Fake <IHttpContextAccessor>();
            fakeProductDataService  = A.Fake <IProductDataService>();
            fakeLogger = A.Fake <ILogger <ProductDataController> >();
            A.CallTo(() => fakeHttpContextAccessor.HttpContext).Returns(new DefaultHttpContext());

            controller = new ProductDataController(fakeHttpContextAccessor, fakeLogger, fakeProductDataService);
        }
Ejemplo n.º 2
0
        public static void Initialize()
        {
            m_Context = new InventoryDbContext();
            m_Context.Initialize();
            m_ProductDataController     = new ProductDataController(m_Context);
            m_CategoryDataController    = new CategoryDataController(m_Context);
            m_CustomerDataController    = new CustomerDataController(m_Context);
            m_TransactionDataController = new TransactionDataController(m_Context);
            m_StockDataController       = new StockDataController(m_Context);
            m_VendorDataController      = new VendorDataController(m_Context);
            m_purchaseDataController    = new PurchaseDataController(m_Context);

            AddDefaultCategory();
        }