public void TestDistributionCenterPropertyIsFullReturnsTrue()
        {
            var DistributionCenter = new DistributionCenter("SmartSolutions");
            var hardDirve          = new HardDrive(123);

            DistributionCenter.GetVehicle(0).LoadProduct(hardDirve);
            DistributionCenter.GetVehicle(0).LoadProduct(hardDirve);
            DistributionCenter.UnloadVehicle(0);
            Assert.IsTrue(DistributionCenter.IsFull, "DistributionCenter should be full.");
        }
        public void TestDistributionCenterUnloadProductReturnsTheCorrectNumberOfUnloadedProducts()
        {
            var distributionCenter = new DistributionCenter("SmartSolutions");
            var hardDirve          = new HardDrive(123);

            distributionCenter.GetVehicle(0).LoadProduct(hardDirve);
            distributionCenter.GetVehicle(0).LoadProduct(hardDirve);

            Assert.AreEqual(distributionCenter.UnloadVehicle(0), 2, "Doesnt unload the correct number of products");
        }
        public void TestDistributionCenterUnloadProductThrowsExceptionWhenStorageIsfull()
        {
            var distributionCenter = new DistributionCenter("SmartSolutions");
            var hardDirve          = new HardDrive(123);

            distributionCenter.GetVehicle(0).LoadProduct(hardDirve);
            distributionCenter.GetVehicle(0).LoadProduct(hardDirve);
            distributionCenter.UnloadVehicle(0);
            distributionCenter.GetVehicle(0).LoadProduct(hardDirve);
            Assert.Throws <InvalidOperationException>(() => distributionCenter.UnloadVehicle(0), "Doesnt Throw Exception when storage house if full.");
        }
        public void TestDistributionCenterProperyProductsReturnsTheCorrectElements()
        {
            var distributionCenter = new DistributionCenter("SmartSolutions");
            var hardDirve          = new HardDrive(123);

            distributionCenter.GetVehicle(0).LoadProduct(hardDirve);
            distributionCenter.UnloadVehicle(0);
            Assert.AreEqual(distributionCenter.Products.ElementAt(0), hardDirve, "Product is not the same as expected.");
        }
        public void TestDistributionCenterGetVehicleReturnsExistingVehicleInTheGarrage(int target)
        {
            var distributionCenter = new DistributionCenter("SmartSolutions");

            Assert.AreEqual(distributionCenter.GetVehicle(target).GetType().Name, typeof(Van).Name, "Does not return the same type vehicle.");
        }
        public void TestDistributionCenterGetVehicleThrowsExceptionWhenAccessingNullGarageSlot()
        {
            var distributionCenter = new DistributionCenter("SmartSolutions");

            Assert.Throws <InvalidOperationException>(() => distributionCenter.GetVehicle(4), "DistributionCenter returns non existing vehicle.");
        }