public void isMatrizSummation() { var initialRow = 1; var endRow = 2; var expectedResult = 27; var matrizBl = new MatrizBL(); Assert.AreEqual(expectedResult, matrizBl.MatrizSummation(GetMatriz(), endRow, initialRow)); }
public void TestMethod1() { IPuntoDTO pIni, pFin, pUpdate; MatrizBL matrizBL = new MatrizBL(); long respuesta = 0; pIni = new IPuntoDTO(); pFin = new IPuntoDTO(); pUpdate = new IPuntoDTO(); //QUERY 1 1 1 3 3 3 pIni.x = 1; pIni.y = 1; pIni.z = 1; pFin.x = 3; pFin.y = 3; pFin.z = 3; respuesta = matrizBL.QueryMatiz(pIni, pFin); Assert.AreEqual(4, respuesta); //UPDATE 1 1 1 23 pUpdate.x = 1; pUpdate.y = 1; pUpdate.z = 1; pUpdate.valor = 23; matrizBL.UpdateMatriz(pUpdate); //QUERY 2 2 2 4 4 4 pIni.x = 2; pIni.y = 2; pIni.z = 2; pFin.x = 4; pFin.y = 4; pFin.z = 4; respuesta = matrizBL.QueryMatiz(pIni, pFin); Assert.AreEqual(4, respuesta); //QUERY 1 1 1 3 3 3 pIni.x = 1; pIni.y = 1; pIni.z = 1; pFin.x = 3; pFin.y = 3; pFin.z = 3; respuesta = matrizBL.QueryMatiz(pIni, pFin); Assert.AreEqual(27, respuesta); }
public IHttpActionResult ExecuteQuery(Models.QueryModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var matrizBl = new MatrizBL(); var summation = matrizBl.ExecuteQuery(model.QueryType, model.NumberOfRow, model.NumberOfEndRow, model.Value); return(Ok(summation)); }
public IHttpActionResult PostMatriz(Models.MatrizModel matriz) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var matrizBl = new MatrizBL(); matrizBl.CreateMatriz(matriz.Matriz, matriz.NumberOfRows); return(CreatedAtRoute("DefaultApi", new { id = matriz.Matriz.Id }, matriz.Matriz)); }
public void HasMatrizCreated() { var newMatriz = new Matriz { Operations = 1 }; var numberOfRows = 1; var matrizBl = new MatrizBL(); matrizBl.CreateMatriz(newMatriz, numberOfRows); Assert.IsTrue(newMatriz.Id > 0); }