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); }
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); }
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); }
private uint GetNeededBoards(Size roomSize, Size boardSize) { uint boardsOnWidth = GetNeededBoardsOnSide(roomSize.length, boardSize.length); uint boardsOnLength = GetNeededBoardsOnSide(roomSize.width, boardSize.width); return boardsOnWidth * boardsOnLength; }
private uint ComputeNeededBoards(Size roomSize, Size boardSize, uint lossesPercentage) { uint boards = GetNeededBoards(roomSize, boardSize); uint boardsToCoverLosses = GetLosses(boards, lossesPercentage); return boards + boardsToCoverLosses; }
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); }