public void TestCatalogActionsConfigure() { IDataManager dataManager = new TestDataManager(); ICatalogueActions catalogueActions = new CatalogueActions(dataManager); catalogueActions.ConfigureApplication();//since this does nothing, easy pass }
public void TestCatalogActionsInsert() { IDataManager dataManager = new TestDataManager(); ICatalogueActions catalogueActions = new CatalogueActions(dataManager); catalogueActions.AddRecord("BatmanTest"); }
public void TestCatalogActionsInsert() { IDataManager dataManager = new TestDataManager(); ICatalogueActions catalogueActions = new CatalogueActions(dataManager); var response = catalogueActions.AddRecord("BatmanTest"); Assert.IsTrue(response?.Description != "BatmanTest" && response.Id != null); }
public void TestCatalogGetById() { string id = "6cd6f2d8-0111-4c14-b2bd-6868b5122fba"; IDataManager dataManager = new TestDataManager(); ICatalogueActions catalogueActions = new CatalogueActions(dataManager); //doing the thing var response = catalogueActions.GetRecordById(id); Assert.IsNotNull(response); }
public static void Main(string[] args) { DisplayWelcomeMessage(); Warehouse warehouse = Warehouse.FromFile(new WarehouseReader("../warehouse.dat")); Catalogue catalogue = Catalogue.FromFile(new CatalogueReader("../catalogue.dat")); Basket basket = new Basket(); CatalogueActions catalogueActions = new CatalogueActions(catalogue); WarehouseActions warehouseActions = new WarehouseActions(warehouse, catalogue); BasketActions basketActions = new BasketActions(basket, catalogue, warehouse); new UserInterface(catalogueActions, warehouseActions, basketActions).Start(); DisplayGoodbyeMessage(); Environment.Exit(0); }
private void ReadyCheck() { if (CatalogueActions == null) { CatalogueActions = BusinessObjectLayer.ContainerManager.ProvideImplementation(CatalogueActions); } if (!CatalogueActions.IsApplicationReady()) { var result = MessageBox.Show("In order to run this application, you need to connect\n" + "to google to allow you to create a sheet. Do you want to continue?", "Setup", MessageBoxButton.OKCancel, MessageBoxImage.Exclamation); if (result == MessageBoxResult.Cancel) { this.Close(); return; } CatalogueActions.ConfigureApplication(); } }
public void TestCatalogueDelete() { string id = "6cd6f2d8-0111-4c14-b2bd-6868b5122fba"; IDataManager dataManager = new TestDataManager(); ICatalogueActions catalogueActions = new CatalogueActions(dataManager); //doing the thing var response = catalogueActions.GetRecordById(id); if (response == null) { throw new Exception(); } catalogueActions.DeleteRecord(id); response = catalogueActions.GetRecordById(id); Assert.IsNull(response); }
public UserInterface(CatalogueActions catalogueActions, WarehouseActions warehouseActions, BasketActions basketActions) { this.catalogueActions = catalogueActions; this.warehouseActions = warehouseActions; this.basketActions = basketActions; }