Example #1
0
        public void TestAutomatedWarehouseSendVehicleSendsVehiclesAndReturnsTheCorrectSlot()
        {
            var automatedWarehouse = new AutomatedWarehouse("SmartSolutions");
            var distributionCenter = new DistributionCenter("SmartTech");


            Assert.AreEqual(automatedWarehouse.SendVehicleTo(0, distributionCenter), 3, "Doesnt return the correct added slot from delivery location.");
        }
Example #2
0
        public void TestAutomatedWarehouseSendVehicleSendsVehicles()
        {
            var automatedWarehouse = new AutomatedWarehouse("SmartSolutions");
            var distributionCenter = new DistributionCenter("SmartTech");

            automatedWarehouse.SendVehicleTo(0, distributionCenter);

            Assert.AreEqual(automatedWarehouse.Garage.ElementAt(0), null, "When sending vehicles doesnt reflect in the current Storage.");
        }
Example #3
0
        public void TestAutomatedWarehouseSendVehicleSendsVehiclesAndSetsTheDeliveryLocationCorrectly()
        {
            var automatedWarehouse = new AutomatedWarehouse("SmartSolutions");
            var distributionCenter = new DistributionCenter("SmartTech");

            automatedWarehouse.SendVehicleTo(0, distributionCenter);

            Assert.AreEqual(distributionCenter.Garage.ElementAt(3).GetType().Name, typeof(Truck).Name, "When sending vehicles doesnt reflect in the delivery Storage.");
        }
Example #4
0
        public void SendVehicle_ShouldThrowExceptionForAutomatedWarehouseWhenNotEmptySlotsAvailableAtDestinationStorage()
        {
            this.storage = new AutomatedWarehouse("Test Automated Warehouse");

            var secondStorage = new AutomatedWarehouse("Second Automated Warehouse");
            var thirdStorage  = new AutomatedWarehouse("Third Automated Warehouse");

            secondStorage.SendVehicleTo(0, this.storage);

            Assert.Throws <InvalidOperationException>(() => thirdStorage.SendVehicleTo(0, this.storage));
        }
Example #5
0
        public void TestAutomatedWarehouseThrowsExceptionWhenDeliveryLocationIsfull()
        {
            var automatedWarehouse = new AutomatedWarehouse("SmartSolutions");
            var distributionCenter = new DistributionCenter("SmartTech");
            var warehouse          = new Warehouse("SmartINC");

            warehouse.SendVehicleTo(0, distributionCenter);
            warehouse.SendVehicleTo(1, distributionCenter);

            Assert.Throws <InvalidOperationException>(() => automatedWarehouse.SendVehicleTo(0, distributionCenter), "Doesnt throw exception when delivery location is full.");
        }