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"));
        }
Exemplo n.º 2
0
        public void ValidateSelectVehicle()
        {
            StorageMaster storageMaster = new StorageMaster();

            storageMaster.RegisterStorage("DistributionCenter", "Pepi");
            Assert.AreEqual("Selected Van", (storageMaster.SelectVehicle("Pepi", 0)));
        }
Exemplo n.º 3
0
        public void TestRegister()
        {
            StorageMaster storageMaster = new StorageMaster();
            var           temp          = storageMaster.RegisterStorage("Warehouse", "Pesho");

            Assert.That($"Registered Pesho", Is.EqualTo(temp));
        }
        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));
        }
        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));
        }
Exemplo n.º 9
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);
        }
Exemplo n.º 10
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 TestLoadVehicleWithIOE()
        {
            StorageMaster master = new StorageMaster();

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

            Assert.Throws <InvalidOperationException>(() => master.LoadVehicle(products));
        }
Exemplo n.º 12
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"));
        }
        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));
        }
Exemplo n.º 14
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));
        }
Exemplo n.º 15
0
 public void StorageMasterRegisterStorageReturnsCorrectMessage()
 {
     Assert.AreEqual(storageMaster.RegisterStorage("Warehouse", "SmartSolutions"), "Registered SmartSolutions", "Doesnt return the correct message when registering a storage.");
 }
        public void TestRegisterStorage()
        {
            StorageMaster master = new StorageMaster();

            Assert.AreEqual("Registered Pesho", master.RegisterStorage("Warehouse", "Pesho"));
        }