Beispiel #1
0
        public void Compute_Boards_Needed_When_BoardSide_Length_Or_Width_Is_Zero()
        {
            Size boardSize = new Size(0, 10);
            Size roomSize = new Size(3000, 7000);
            uint lossesPercentage = 15;

            uint neededBoards = ComputeNeededBoards(roomSize, boardSize, lossesPercentage);

            Assert.AreEqual<uint>(0, neededBoards);
        }
Beispiel #2
0
        public void Compute_Boards_Needed_When_BoardSide_Is_Not_Exact_Multiple_For_Floor_Length_Or_Width()
        {
            Size boardSize = new Size(300, 700);
            Size roomSize = new Size(3100, 7100);
            uint lossesPercentage = 15;

            uint neededBoards = ComputeNeededBoards(roomSize, boardSize, lossesPercentage);

            Assert.AreEqual<uint>(139, neededBoards);
        }
Beispiel #3
0
        public void Compute_Boards_Needed_When_Ll_Input_Values_Are_Zero()
        {
            Size boardSize = new Size(0, 0);
            Size roomSize = new Size(0, 0);
            uint lossesPercentage = 0;

            uint neededBoards = ComputeNeededBoards(roomSize, boardSize, lossesPercentage);

            Assert.AreEqual<uint>(0, neededBoards);
        }
Beispiel #4
0
 private uint GetNeededBoards(Size roomSize, Size boardSize)
 {
     uint boardsOnWidth = GetNeededBoardsOnSide(roomSize.length, boardSize.length);
     uint boardsOnLength = GetNeededBoardsOnSide(roomSize.width, boardSize.width);
     return boardsOnWidth * boardsOnLength;
 }
Beispiel #5
0
 private uint ComputeNeededBoards(Size roomSize, Size boardSize, uint lossesPercentage)
 {
     uint boards = GetNeededBoards(roomSize, boardSize);
     uint boardsToCoverLosses = GetLosses(boards, lossesPercentage);
     return boards + boardsToCoverLosses;
 }
Beispiel #6
0
        public void Compute_Boards_Needed_When_Losses_Percentage_Is_Zero()
        {
            Size boardSize = new Size(300, 700);
            Size roomSize = new Size(3000, 7000);
            uint lossesPercentage = 0;

            uint neededBoards = ComputeNeededBoards(roomSize, boardSize, lossesPercentage);

            Assert.AreEqual<uint>(100, neededBoards);
        }