public void TestMatrixGeneratedWithCorrectDimensions(int letterIndex, int width) { var matrix = new DiamondMatrix(letterIndex); // row width/dimension length Assert.Equal(width, matrix.Matrix.GetLength(0)); // column height/dimension length Assert.Equal(width, matrix.Matrix.GetLength(1)); }
public string[,] Start(ILetterLookupSvc letter) { var letterLookup = letter; var letterIndex = letterLookup.ChosenLetterAlphabetIndex; var blankMatrix = new DiamondMatrix(letterIndex); var matrix = blankMatrix.Matrix; _matrixPopulator.PopulateMatrix(matrix, letter); return(matrix); }
public void TestPopulateMatrix(string chosenLetter, string assertLetter, int horizontalIndexLeft, int horizontalIndexRight, int verticalIndex) { // arrange var lookup = new LetterLookupSvc(chosenLetter); var matrixObject = new DiamondMatrix(lookup.ChosenLetterAlphabetIndex); var matrix = matrixObject.Matrix; var matrixPopulator = new MatrixPopulator(); // act matrixPopulator.PopulateMatrix(matrix, lookup); // assert Assert.Equal(assertLetter, matrix[verticalIndex, horizontalIndexLeft]); Assert.Equal(assertLetter, matrix[verticalIndex, horizontalIndexRight]); }
public void TestMatrixDimensionsCalculation(int letterIndex, int width) { var matrix = new DiamondMatrix(letterIndex); Assert.Equal(width, matrix.MatrixWidth); }