Ejemplo n.º 1
0
        public void Test_Place_Valuable_On_CooledAndValuable()
        {
            //In this test method we will test if we can place a valuable container on top of cooled & valuable container
            CooledAndValuable container1 = new CooledAndValuable(250);
            ValuableContainer container2 = new ValuableContainer(250);
            bool bcontainer1             = false;
            bool bcontainer2             = false;

            //Act we place the cooledvalueble first.
            if (stack.CanAddContainer(container1))
            {
                stack.AddContainerToStack(container1);
                bcontainer1 = true;
            }

            if (stack.CanAddContainer(container2))
            {
                stack.AddContainerToStack(container2);
                bcontainer2 = true;
            }

            //Assert
            Assert.AreEqual(true, bcontainer1);
            Assert.AreEqual(false, bcontainer2);
        }
Ejemplo n.º 2
0
        public void Place_ValuableAndCooled()
        {
            //In this test I test if i have 1 row but 2 containers the container will be added to the falselist
            List <CooledAndValuable> listContainers = new List <CooledAndValuable>();
            CooledAndValuable        container1     = new CooledAndValuable(250);
            CooledAndValuable        container2     = new CooledAndValuable(250);

            ship.width  = 1;
            ship.length = 2;
            balanceAlgorithme.SetShip(ship);
            listContainers.Add(container1);
            listContainers.Add(container2);
            balanceAlgorithme.cvList = listContainers;

            //Act
            balanceAlgorithme.FillShip();

            //Assert
            Assert.AreEqual(container2, balanceAlgorithme.falseList[0]);
        }