public void PlaceNormalCooledAndValuableContainers()
        {
            Ship ship = new Ship(3, 4);

            List <Container> containerList = new List <Container>();

            for (int i = 1; i <= 30; i++)
            {
                Container container = new Container(30000, ContainerType.Normal);
                containerList.Add(container);
            }

            for (int i = 1; i <= 10; i++)
            {
                Container container = new Container(19999, ContainerType.Cooled);
                containerList.Add(container);
            }

            for (int i = 1; i <= 6; i++)
            {
                Container container = new Container(20000, ContainerType.Valuable);
                containerList.Add(container);
            }

            ContainerDistribution cDistributor = new ContainerDistribution(ship, containerList);

            Assert.AreEqual(true, cDistributor.PlaceAllContainers());
        }
Ejemplo n.º 2
0
        public void CheckWeightOddShipWidth()
        {
            Ship ship = new Ship(5, 1);

            List <Container> containerList = new List <Container>();

            for (int i = 1; i <= 20; i++)
            {
                Container container = new Container(30000, ContainerType.Normal);
                containerList.Add(container);
            }

            ContainerDistribution cDistributor = new ContainerDistribution(ship, containerList);

            Assert.AreEqual(true, cDistributor.PlaceAllContainers());
        }
        public void PlaceNormalContainersOnThreeStacks()
        {
            Ship ship = new Ship(3, 1);

            List <Container> containerList = new List <Container>();

            for (int i = 1; i <= 15; i++)
            {
                Container container = new Container(29000, ContainerType.Normal);
                containerList.Add(container);
            }

            ContainerDistribution cDistributor = new ContainerDistribution(ship, containerList);

            Assert.AreEqual(true, cDistributor.PlaceAllContainers());
        }
        public void PlaceValueableContainersWithOnly1Row()
        {
            Ship ship = new Ship(1, 1);

            List <Container> containerList = new List <Container>();

            for (int i = 1; i <= 3; i++)
            {
                Container container = new Container(25000, ContainerType.Valuable);
                containerList.Add(container);
            }

            ContainerDistribution cDistributor = new ContainerDistribution(ship, containerList);

            Assert.AreEqual(false, cDistributor.PlaceAllContainers());
        }
        public void PlaceCooledContainersOnOneStack()
        {
            Ship ship = new Ship(1, 2);

            List <Container> containerList = new List <Container>();

            for (int i = 1; i <= 6; i++)
            {
                Container container = new Container(30000, ContainerType.Cooled);
                containerList.Add(container);
            }

            ContainerDistribution cDistribution = new ContainerDistribution(ship, containerList);

            Assert.AreEqual(false, cDistribution.PlaceAllContainers());
        }
        public void PlaceTooManyValueableContainers()
        {
            Ship ship = new Ship(4, 4);

            List <Container> containerList = new List <Container>();

            for (int i = 1; i <= 30; i++)
            {
                Container container = new Container(25000, ContainerType.Normal);
                containerList.Add(container);
            }

            for (int i = 1; i <= 20; i++)
            {
                Container container = new Container(25000, ContainerType.Valuable);
                containerList.Add(container);
            }

            ContainerDistribution cDistributor = new ContainerDistribution(ship, containerList);

            Assert.AreEqual(false, cDistributor.PlaceAllContainers());
        }