Ejemplo n.º 1
0
        public void ValidarDatosDeEntradaCoValorCoordenadaXEnOperacionQueryErroneo()
        {
            InformacionSecuenciaOperacion informacionOperacion = new InformacionSecuenciaOperacion();

            informacionOperacion.ValoresOperacion = new List <string>();

            informacionOperacion.ValoresOperacion.Add("2");
            informacionOperacion.ValoresOperacion.Add("4 5");
            informacionOperacion.ValoresOperacion.Add("UPDATE 2 2 2 4");
            informacionOperacion.ValoresOperacion.Add("QUERY 1 1 1 3 3 3");
            informacionOperacion.ValoresOperacion.Add("UPDATE 1 1 1 23");
            informacionOperacion.ValoresOperacion.Add("QUERY 2 2 2 4 4 4");
            informacionOperacion.ValoresOperacion.Add("QUERY 1 1 1 3 3 3");
            informacionOperacion.ValoresOperacion.Add("2 4");
            informacionOperacion.ValoresOperacion.Add("UPDATE 2 2 2 1");
            informacionOperacion.ValoresOperacion.Add("QUERY 4 1 1 1 1 1");
            informacionOperacion.ValoresOperacion.Add("QUERY 1 1 1 2 2 2");
            informacionOperacion.ValoresOperacion.Add("QUERY 2 2 2 2 2 2");

            CubeSummationController cubeSummationController = new CubeSummationController();

            List <string> listaMensajesValidacion = cubeSummationController.ValidacionReglasDatosEntrada(informacionOperacion);

            Assert.AreEqual("El valor de cada cordenada de la operación QUERY debe estar entre 1 y 2", listaMensajesValidacion[0]);
        }
Ejemplo n.º 2
0
        public void ValidarDatosDeEntradaCoTamañoMatrizErroneo()
        {
            InformacionSecuenciaOperacion informacionOperacion = new InformacionSecuenciaOperacion();

            informacionOperacion.ValoresOperacion = new List <string>();

            informacionOperacion.ValoresOperacion.Add("2");
            informacionOperacion.ValoresOperacion.Add("101 5");
            informacionOperacion.ValoresOperacion.Add("UPDATE 2 2 2 4");
            informacionOperacion.ValoresOperacion.Add("QUERY 1 1 1 3 3 3");
            informacionOperacion.ValoresOperacion.Add("UPDATE 1 1 1 23");
            informacionOperacion.ValoresOperacion.Add("QUERY 2 2 2 4 4 4");
            informacionOperacion.ValoresOperacion.Add("QUERY 1 1 1 3 3 3");
            informacionOperacion.ValoresOperacion.Add("2 4");
            informacionOperacion.ValoresOperacion.Add("UPDATE 2 2 2 1");
            informacionOperacion.ValoresOperacion.Add("QUERY 1 1 1 1 1 1");
            informacionOperacion.ValoresOperacion.Add("QUERY 1 1 1 2 2 2");
            informacionOperacion.ValoresOperacion.Add("QUERY 2 2 2 2 2 2");

            CubeSummationController cubeSummationController = new CubeSummationController();

            List <string> listaMensajesValidacion = cubeSummationController.ValidacionReglasDatosEntrada(informacionOperacion);

            Assert.AreEqual("El tamaño de la matriz debe estar entre 1 y 100", listaMensajesValidacion[0]);
        }
Ejemplo n.º 3
0
        public void ValidarResultadoConDatosDeEntradaDelEjercicioOriginal()
        {
            InformacionSecuenciaOperacion informacionOperacion = new InformacionSecuenciaOperacion();

            informacionOperacion.ValoresOperacion = new List <string>();
            List <string> resultadoOperacion = new List <string>();


            informacionOperacion.ValoresOperacion.Add("2");
            informacionOperacion.ValoresOperacion.Add("4 5");
            informacionOperacion.ValoresOperacion.Add("UPDATE 2 2 2 4");
            informacionOperacion.ValoresOperacion.Add("QUERY 1 1 1 3 3 3");
            informacionOperacion.ValoresOperacion.Add("UPDATE 1 1 1 23");
            informacionOperacion.ValoresOperacion.Add("QUERY 2 2 2 4 4 4");
            informacionOperacion.ValoresOperacion.Add("QUERY 1 1 1 3 3 3");
            informacionOperacion.ValoresOperacion.Add("2 4");
            informacionOperacion.ValoresOperacion.Add("UPDATE 2 2 2 1");
            informacionOperacion.ValoresOperacion.Add("QUERY 1 1 1 1 1 1");
            informacionOperacion.ValoresOperacion.Add("QUERY 1 1 1 2 2 2");
            informacionOperacion.ValoresOperacion.Add("QUERY 2 2 2 2 2 2");

            CubeSummationController cubeSummationController = new CubeSummationController();

            resultadoOperacion = cubeSummationController.EjecutarCubeSummationTest(informacionOperacion);

            List <string> resultadoOperacionEsperado = new List <string>();

            resultadoOperacionEsperado.Add("4");
            resultadoOperacionEsperado.Add("4");
            resultadoOperacionEsperado.Add("27");
            resultadoOperacionEsperado.Add("0");
            resultadoOperacionEsperado.Add("1");
            resultadoOperacionEsperado.Add("1");

            CollectionAssert.AreEqual(resultadoOperacion, resultadoOperacionEsperado);
        }
Ejemplo n.º 4
0
 public void Setup()
 {
     controller               = new CubeSummationController();
     controller.Request       = new HttpRequestMessage();
     controller.Configuration = new HttpConfiguration();
 }