public void DoAllContainersHaveASpot2()
        {
            List <Container> testContainers = new List <Container>();

            Containervervoer_Methods.Models.Ship testShip = new Containervervoer_Methods.Models.Ship(2, 2);

            testShip.AddContainerToShip(MockContainers.testContainers[7]);
            testShip.AddContainerToShip(MockContainers.testContainers[7]);
            testShip.AddContainerToShip(MockContainers.testContainers[8]);

            testContainers.Add(MockContainers.testContainers[7]);
            testContainers.Add(MockContainers.testContainers[7]);
            testContainers.Add(MockContainers.testContainers[8]);

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

            foreach (var row in testShip.rowList)
            {
                foreach (var stack in row.stackList)
                {
                    foreach (var container in stack.containerList)
                    {
                        actualContainers.Add(container);
                    }
                }
            }

            CollectionAssert.AreEqual(testContainers, actualContainers);
            //Rows
            Assert.AreEqual(2, testShip.rowList.Count);
        }
Exemple #2
0
        public void DoAllContainershaveAPlace3()
        {
            // Arrange
            shipTest = MockShips.testShip4;

            // Act
            for (int i = 0; i < 6; i++)
            {
                containerListTest.Add(MockContainers.testContainers[11]);
            }
            for (int i = 0; i < 6; i++)
            {
                containerListTest.Add(MockContainers.testContainers[9]);
            }
            for (int i = 0; i < 6; i++)
            {
                containerListTest.Add(MockContainers.testContainers[10]);
            }

            foreach (var container in containerListTest)
            {
                shipTest.AddContainerToShip(container);
            }
            // Assert
        }
        public void DoAllContainersHaveASpot6()
        {
            List <Container> testContainers = new List <Container>();

            Containervervoer_Methods.Models.Ship testShip = new Containervervoer_Methods.Models.Ship(1, 1);

            testShip.AddContainerToShip(MockContainers.testContainers[5]);
            testShip.AddContainerToShip(MockContainers.testContainers[3]);
            testShip.AddContainerToShip(MockContainers.testContainers[8]);
            testShip.AddContainerToShip(MockContainers.testContainers[5]);
            testShip.AddContainerToShip(MockContainers.testContainers[3]);
        }