示例#1
0
        public void LoadContainer_ShouldReturnFalseNotFit()
        {
            // Arrange
            Ship ship = new Ship(3, 2);
            List <IContainer> containers = Harbor.CreateShipment(5, 0, 10);

            // Act
            bool result = ship.LoadContainers(containers);

            // Assert
            Assert.False(result);
        }
示例#2
0
        public void CanHandleWeight_ShouldWork()
        {
            // Arrange
            Ship ship = new Ship(3, 2);
            List <IContainer> containers = Harbor.CreateShipment(4, 8, 18);

            // Act
            ship.LoadContainers(containers);
            (int, int)halfWeights = ship.GetFrontAndBackWeight();

            // Assert
            Assert.Equal(450, halfWeights.Item1);
        }
示例#3
0
        public void LoadContainers_ShouldWorkSmall()
        {
            // Arrange
            int  expected = 5;
            Ship ship     = new Ship(2, 2);
            List <IContainer> containers = Harbor.CreateShipment(0, 0, 20);

            // Act
            ship.LoadContainers(containers);
            int result = ship.Rows[1].Stacks[1].Containers.Count;

            // Assert
            Assert.Equal(expected, result);
        }