예제 #1
0
        public void RotateMatrixTest()
        {
            Amatrix amatrix = new Amatrix();

            amatrix.GenerateMatrix(5);
            amatrix.RotateMatrix();
            Assert.IsNotNull(amatrix.Matrix);
        }
예제 #2
0
        public void ReadMatrixTest()
        {
            Amatrix amatrix = new Amatrix();

            string[] textLines = new string[] { "1;2;3", "4;5;6", "7;8;9" };
            amatrix.ReadMatrix(textLines);
            Assert.IsNotNull(amatrix.Matrix);
        }
예제 #3
0
        public void About()
        {
            // Arrange
            IAmatrix       m          = new Amatrix();
            HomeController controller = new HomeController(m);

            // Act
            ViewResult result = controller.About() as ViewResult;

            // Assert
            Assert.IsNotNull(result);
        }
예제 #4
0
        public void DownloadCSV()
        {
            // Arrange
            IAmatrix       m          = new Amatrix();
            HomeController controller = new HomeController(m);

            // Act
            controller.GenerateMatrix(5);
            FileContentResult result = controller.DownloadCSV("test") as FileContentResult;

            // Assert
            Assert.IsNotNull(result.FileContents);
        }
예제 #5
0
        public void GenerateMatrix()
        {
            // Arrange
            IAmatrix       m          = new Amatrix();
            HomeController controller = new HomeController(m);

            // Act
            ViewResult result = controller.GenerateMatrix(5) as ViewResult;
            var        r      = (result.Model as Tuple <int[][], int>).Item2;

            // Assert
            Assert.AreEqual(5, r);
        }