示例#1
0
        public void TestCatalogActionsConfigure()
        {
            IDataManager      dataManager      = new TestDataManager();
            ICatalogueActions catalogueActions = new CatalogueActions(dataManager);

            catalogueActions.ConfigureApplication();//since this does nothing, easy pass
        }
示例#2
0
        public void TestCatalogActionsInsert()
        {
            IDataManager      dataManager      = new TestDataManager();
            ICatalogueActions catalogueActions = new CatalogueActions(dataManager);

            catalogueActions.AddRecord("BatmanTest");
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
        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);
        }
示例#6
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();
            }
        }
示例#7
0
        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);
        }
示例#8
0
 public UserInterface(CatalogueActions catalogueActions, WarehouseActions warehouseActions, BasketActions basketActions)
 {
     this.catalogueActions = catalogueActions;
     this.warehouseActions = warehouseActions;
     this.basketActions    = basketActions;
 }