예제 #1
0
        public void ValidateSelectVehicle()
        {
            StorageMaster storageMaster = new StorageMaster();

            storageMaster.RegisterStorage("DistributionCenter", "Pepi");
            Assert.AreEqual("Selected Van", (storageMaster.SelectVehicle("Pepi", 0)));
        }
예제 #2
0
        public static void Main()
        {
            StorageMaster storage = new StorageMaster();
            Engine        engine  = new Engine(storage);

            engine.Run();
        }
예제 #3
0
        public void TestRegister()
        {
            StorageMaster storageMaster = new StorageMaster();
            var           temp          = storageMaster.RegisterStorage("Warehouse", "Pesho");

            Assert.That($"Registered Pesho", Is.EqualTo(temp));
        }
예제 #4
0
        public void ValidateAddProductSecond()
        {
            StorageMaster storageMaster     = new StorageMaster();
            var           tempAddProduct    = storageMaster.AddProduct("Ram", 1159);
            var           expctedAddProduct = "Added Ram to pool";

            Assert.AreEqual(tempAddProduct, expctedAddProduct);
        }
        public void TestSendVehicleToWithIOE1()
        {
            StorageMaster master = new StorageMaster();

            master.RegisterStorage("Warehouse", "Pesho");

            Assert.Throws <InvalidOperationException>(() => master.SendVehicleTo("Pesho", 0, "Gosho"));
        }
        public void TestSelectVehicle()
        {
            StorageMaster master = new StorageMaster();

            master.RegisterStorage("Warehouse", "Pesho");

            Assert.AreEqual("Selected Semi", master.SelectVehicle("Pesho", 0));
        }
예제 #7
0
        public void StorageMasterConstructorShouldCreate()
        {
            //Arrange
            StorageMaster sm = (StorageMaster)Activator.CreateInstance(typeof(StorageMaster));

            //Assert
            Assert.IsTrue(sm.GetType() == typeof(StorageMaster));
        }
        public void TestGetSummary()
        {
            StorageMaster master = new StorageMaster();

            master.RegisterStorage("Warehouse", "Pesho");

            Assert.AreEqual("Pesho:\r\nStorage worth: $0.00", master.GetSummary());
        }
        public void TestGetStorageStatus()
        {
            StorageMaster master = new StorageMaster();

            master.RegisterStorage("Warehouse", "Pesho");

            Assert.AreEqual("Stock (0/10): []\r\nGarage: [Semi|Semi|Semi|empty|empty|empty|empty|empty|empty|empty]", master.GetStorageStatus("Pesho"));
        }
        public void TestUnloadVehicle()
        {
            StorageMaster master = new StorageMaster();

            master.RegisterStorage("Warehouse", "Pesho");

            Assert.AreEqual("Unloaded 1/1 products at Pesho", master.UnloadVehicle("Pesho", 0));
        }
예제 #11
0
        public void ValidateGetSummary()
        {
            StorageMaster storage = new StorageMaster();

            storage.RegisterStorage("Warehouse", "Nikolai");
            var printSummary    = storage.GetSummary();
            var expectedSummary = "Nikolai:\r\nStorage worth: $0.00";

            Assert.AreEqual(printSummary, expectedSummary);
        }
        public void TestLoadVehicleWithIOE()
        {
            StorageMaster master = new StorageMaster();

            master.RegisterStorage("Warehouse", "Pesho");
            master.SelectVehicle("Pesho", 0);
            string[] products = new string[] { "Gpu" };

            Assert.Throws <InvalidOperationException>(() => master.LoadVehicle(products));
        }
예제 #13
0
        public void ValidateLoadVehicleIE()
        {
            StorageMaster storageMaster = new StorageMaster();

            storageMaster.RegisterStorage("Warehouse", "Pepi");
            storageMaster.SelectVehicle("Pepi", 0);
            var temp = (new string[] { "Ram" });

            Assert.Throws <InvalidOperationException>(() => storageMaster.LoadVehicle(temp));
        }
        public void TestSendVehicleTo()
        {
            StorageMaster master = new StorageMaster();

            master.RegisterStorage("Warehouse", "Pesho");
            master.RegisterStorage("Warehouse", "Gosho");

            Assert.AreEqual("Sent Semi to Gosho (slot 3)", master.SendVehicleTo("Pesho", 1, "Gosho"));
            Assert.AreEqual("Sent Semi to Gosho (slot 4)", master.SendVehicleTo("Pesho", 0, "Gosho"));
        }
        public void TestLoadVehicle()
        {
            StorageMaster master = new StorageMaster();

            master.RegisterStorage("Warehouse", "Pesho");
            master.SelectVehicle("Pesho", 0);
            master.AddProduct("Gpu", 5);
            string[] products = new string[] { "Gpu" };

            Assert.AreEqual("Loaded 1/1 products into Semi", master.LoadVehicle(products));
        }
예제 #16
0
        public void ValidateLoadVehicle()
        {
            StorageMaster storageMaster = new StorageMaster();

            storageMaster.RegisterStorage("Warehouse", "Pepi");
            storageMaster.SelectVehicle("Pepi", 0);
            storageMaster.AddProduct("Ram", 0.2);
            var temp = storageMaster.LoadVehicle(new string[] { "Ram" });

            Assert.That(temp, Is.EqualTo("Loaded 1/1 products into Semi"));
        }
예제 #17
0
        static void Main(string[] args)
        {
            IWriter             writer             = new ConsoleWriter();
            IReader             reader             = new ConsoleReader();
            StorageMaster       storageMaster      = new StorageMaster();
            ICommandInterpreter commandInterpreter = new CommandInterpreter(storageMaster);

            Engine engine = new Engine(writer, reader, commandInterpreter);

            engine.Run();
        }
예제 #18
0
        public void ValidateGetStorageStatus()
        {
            StorageMaster storage = new StorageMaster();
            var           name    = "Pepi";

            storage.RegisterStorage("Warehouse", name);
            var temp          = storage.GetStorageStatus(name);
            var expectedValue =
                "Stock (0/10): []\r\nGarage: [Semi|Semi|Semi|empty|empty|empty|empty|empty|empty|empty]";

            Assert.That(temp, Is.EqualTo(expectedValue));
        }
예제 #19
0
    // Use this for initialization
    void Start()
    {
        FillDictionary();

        storageMasterData = this.GetComponent <StorageMaster>();
        matWindowObject   = transform.FindChild("StorageWindowData").gameObject.transform.FindChild("MaterialWindow").gameObject;
        label1            = matWindowObject.transform.FindChild("Label1").gameObject.GetComponent <UILabel>();
        label1Value       = matWindowObject.transform.FindChild("Label1").gameObject.transform.FindChild("Label1Value").gameObject.GetComponent <UILabel>();
        label2            = matWindowObject.transform.FindChild("Label2").gameObject.GetComponent <UILabel>();
        label2Value       = matWindowObject.transform.FindChild("Label2").gameObject.transform.FindChild("Label2Value").gameObject.GetComponent <UILabel>();
        label3            = matWindowObject.transform.FindChild("Label3").gameObject.GetComponent <UILabel>();
        label3Value       = matWindowObject.transform.FindChild("Label3").gameObject.transform.FindChild("Label3Value").gameObject.GetComponent <UILabel>();
        label4            = matWindowObject.transform.FindChild("Label4").gameObject.GetComponent <UILabel>();
        label4Value       = matWindowObject.transform.FindChild("Label4").gameObject.transform.FindChild("Label4Value").gameObject.GetComponent <UILabel>();
        label5            = matWindowObject.transform.FindChild("Label5").gameObject.GetComponent <UILabel>();
        label5Value       = matWindowObject.transform.FindChild("Label5").gameObject.transform.FindChild("Label5Value").gameObject.GetComponent <UILabel>();
        label6            = matWindowObject.transform.FindChild("Label6").gameObject.GetComponent <UILabel>();
        label6Value       = matWindowObject.transform.FindChild("Label6").gameObject.transform.FindChild("Label6Value").gameObject.GetComponent <UILabel>();

        label7Pipes      = matWindowObject.transform.FindChild("Label7Pipes").gameObject.GetComponent <UILabel>();
        label7PipesValue = matWindowObject.transform.FindChild("Label7Pipes").gameObject.transform.FindChild("Label7PipesValue").gameObject.GetComponent <UILabel>();

        labelShowType = matWindowObject.transform.FindChild("LabelShowType").gameObject.GetComponent <UILabel>();

        GameObject storageWindowDataObject = transform.FindChild("StorageWindowData").gameObject;

        maxStorageLabel = storageWindowDataObject.transform.FindChild("LabelMaxStorage").gameObject.transform.FindChild("LabelMaxStorageValue").gameObject.GetComponent <UILabel>();
        curStorageLabel = storageWindowDataObject.transform.FindChild("LabelCurrentStorage").gameObject.transform.FindChild("LabelCurrentStorageValue").gameObject.GetComponent <UILabel>();

        coleLabelValue    = storageWindowDataObject.transform.FindChild("LabelCole").gameObject.transform.FindChild("LabelColeValue").gameObject.GetComponent <UILabel>();
        oreLabelValue     = storageWindowDataObject.transform.FindChild("LabelOre").gameObject.transform.FindChild("LabelOreValue").gameObject.GetComponent <UILabel>();
        goldLabelValue    = storageWindowDataObject.transform.FindChild("LabelGold").gameObject.transform.FindChild("LabelGoldValue").gameObject.GetComponent <UILabel>();
        oilLabelValue     = storageWindowDataObject.transform.FindChild("LabelOil").gameObject.transform.FindChild("LabelOilValue").gameObject.GetComponent <UILabel>();
        diamondLabelValue = storageWindowDataObject.transform.FindChild("LabelDiamond").gameObject.transform.FindChild("LabelDiamondValue").gameObject.GetComponent <UILabel>();


        storageWindowMenuObject = GameObject.FindGameObjectWithTag("MenuStorage");

        StorageShow();
    } // END Start
    // Use this for initialization
    void Start()
    {

        FillDictionary();

        storageMasterData = this.GetComponent<StorageMaster>();
        matWindowObject = transform.FindChild("StorageWindowData").gameObject.transform.FindChild("MaterialWindow").gameObject;
        label1 = matWindowObject.transform.FindChild("Label1").gameObject.GetComponent<UILabel>();
        label1Value = matWindowObject.transform.FindChild("Label1").gameObject.transform.FindChild("Label1Value").gameObject.GetComponent<UILabel>();
        label2 = matWindowObject.transform.FindChild("Label2").gameObject.GetComponent<UILabel>();
        label2Value = matWindowObject.transform.FindChild("Label2").gameObject.transform.FindChild("Label2Value").gameObject.GetComponent<UILabel>();
        label3 = matWindowObject.transform.FindChild("Label3").gameObject.GetComponent<UILabel>();
        label3Value = matWindowObject.transform.FindChild("Label3").gameObject.transform.FindChild("Label3Value").gameObject.GetComponent<UILabel>();
        label4 = matWindowObject.transform.FindChild("Label4").gameObject.GetComponent<UILabel>();
        label4Value = matWindowObject.transform.FindChild("Label4").gameObject.transform.FindChild("Label4Value").gameObject.GetComponent<UILabel>();
        label5 = matWindowObject.transform.FindChild("Label5").gameObject.GetComponent<UILabel>();
        label5Value = matWindowObject.transform.FindChild("Label5").gameObject.transform.FindChild("Label5Value").gameObject.GetComponent<UILabel>();
        label6 = matWindowObject.transform.FindChild("Label6").gameObject.GetComponent<UILabel>();
        label6Value = matWindowObject.transform.FindChild("Label6").gameObject.transform.FindChild("Label6Value").gameObject.GetComponent<UILabel>();

        label7Pipes = matWindowObject.transform.FindChild("Label7Pipes").gameObject.GetComponent<UILabel>();
        label7PipesValue = matWindowObject.transform.FindChild("Label7Pipes").gameObject.transform.FindChild("Label7PipesValue").gameObject.GetComponent<UILabel>();

        labelShowType = matWindowObject.transform.FindChild("LabelShowType").gameObject.GetComponent<UILabel>();

        GameObject storageWindowDataObject = transform.FindChild("StorageWindowData").gameObject;
        maxStorageLabel = storageWindowDataObject.transform.FindChild("LabelMaxStorage").gameObject.transform.FindChild("LabelMaxStorageValue").gameObject.GetComponent<UILabel>();
        curStorageLabel = storageWindowDataObject.transform.FindChild("LabelCurrentStorage").gameObject.transform.FindChild("LabelCurrentStorageValue").gameObject.GetComponent<UILabel>();

        coleLabelValue = storageWindowDataObject.transform.FindChild("LabelCole").gameObject.transform.FindChild("LabelColeValue").gameObject.GetComponent<UILabel>();
        oreLabelValue = storageWindowDataObject.transform.FindChild("LabelOre").gameObject.transform.FindChild("LabelOreValue").gameObject.GetComponent<UILabel>();
        goldLabelValue = storageWindowDataObject.transform.FindChild("LabelGold").gameObject.transform.FindChild("LabelGoldValue").gameObject.GetComponent<UILabel>();
        oilLabelValue = storageWindowDataObject.transform.FindChild("LabelOil").gameObject.transform.FindChild("LabelOilValue").gameObject.GetComponent<UILabel>();
        diamondLabelValue = storageWindowDataObject.transform.FindChild("LabelDiamond").gameObject.transform.FindChild("LabelDiamondValue").gameObject.GetComponent<UILabel>();


        storageWindowMenuObject = GameObject.FindGameObjectWithTag("MenuStorage");

        StorageShow();
    } // END Start
 public AddProductCommand(StorageMaster storageMaster)
 {
     this.storageMaster = storageMaster;
 }
예제 #22
0
 public void Setup()
 {
     this.storageMaster = new StorageMaster();
 }
예제 #23
0
 public void SetUp()
 {
     this.storageMaster      = new StorageMaster();
     this.distributionCenter = new DistributionCenter("FlakTower");
 }
예제 #24
0
 public void SetUp()
 {
     this.storageMaster = new StorageMaster();
     this.warehouse     = new Warehouse("GustavCanon");
 }
        public void TestRegisterStorage()
        {
            StorageMaster master = new StorageMaster();

            Assert.AreEqual("Registered Pesho", master.RegisterStorage("Warehouse", "Pesho"));
        }
        public void TestAddProduct()
        {
            StorageMaster master = new StorageMaster();

            Assert.AreEqual("Added Gpu to pool", master.AddProduct("Gpu", 5));
        }
예제 #27
0
 public void Setup()
 {
     this.storageFactory = new StorageFactory();
     this.storageMaster  = new StorageMaster();
 }
예제 #28
0
 public void LoadStorageManiger()
 {
     this.storegeMaster = new StorageMaster();
 }
 public UnloadVehicleCommand(StorageMaster storageMaster)
 {
     this.storageMaster = storageMaster;
 }
예제 #30
0
 public GetStorageStatusCommand(StorageMaster storageMaster)
 {
     this.storageMaster = storageMaster;
 }
예제 #31
0
 public SendVehicleToCommand(StorageMaster storageMaster)
 {
     this.storageMaster = storageMaster;
 }