Beispiel #1
0
        public void Initialize()
        {
            _graph = new AttributeTest
            {
                Title = "Hello",
                OneToManyAssociated = new List <AttributeTestOneToManyAssociated>
                {
                    new AttributeTestOneToManyAssociated
                    {
                        Title = "Hello"
                    }
                },
                OneToManyOwned = new List <AttributeTestOneToManyOwned>
                {
                    new AttributeTestOneToManyOwned
                    {
                        Title = "Hello",
                        AttributeTestOneToManyToOneAssociated = new AttributeTestOneToManyToOneAssociated
                        {
                            Title = "Hello"
                        },
                        AttributeTestOneToManyToOneOwned = new AttributeTestOneToManyToOneOwned
                        {
                            Title = "Hello"
                        }
                    }
                }
            };

            _sharedModelTestGraph = new SharedModelAttributeTest
            {
                Title = "Hello",
                OneToManyAssociated = new List <AttributeTestOneToManyAssociated>
                {
                    new AttributeTestOneToManyAssociated
                    {
                        Title = "Hello"
                    }
                },
                OneToManyOwned = new List <AttributeTestOneToManyOwned>
                {
                    new AttributeTestOneToManyOwned
                    {
                        Title = "Hello",
                        AttributeTestOneToManyToOneAssociated = new AttributeTestOneToManyToOneAssociated
                        {
                            Title = "Hello"
                        },
                        AttributeTestOneToManyToOneOwned = new AttributeTestOneToManyToOneOwned
                        {
                            Title = "Hello"
                        },
                        SharedModelTesting = new AttributeTestOneToManyToOneOwned
                        {
                            Title = "Hellox"
                        }
                    }
                }
            };
        }
Beispiel #2
0
        public void Create_NonNullOnNullable_Attributes()
        {
            // arrange
            IValueNode value = Utf8GraphQLParser.Syntax.ParseValueLiteral(
                "{ nonNullOnNullable: { eq: THIRD }}");
            ExecutorBuilder?tester = CreateProviderTester(new FilterInputType <AttributeTest>());

            // act
            Func <AttributeTest, bool>?func = tester.Build <AttributeTest>(value);

            // assert
            var a = new AttributeTest {
                NonNullOnNullable = TestEnum.Third
            };

            Assert.True(func(a));

            var b = new AttributeTest {
                NonNullOnNullable = TestEnum.First
            };

            Assert.False(func(b));

            var c = new AttributeTest {
                NonNullOnNullable = null
            };

            Assert.False(func(c));
        }
Beispiel #3
0
        public void HasAttribute()
        {
            AttributeTest hasAttribute = new AttributeTest();

            object noAttribute = new object();

            Assert.False(noAttribute.GetType().HasCustomAttribute <AttributeTestAttribute>());
            Assert.True(hasAttribute.GetType().HasCustomAttribute <AttributeTestAttribute>());
        }
Beispiel #4
0
        public static RepresentanteComercial GetRepresentanteComercial(string username)
        {
            Query         supQuery = new Query();
            AttributeTest at       = AttributeTest.Equal("usuario", username);

            supQuery.Where(at);

            return(RepresentanteComercial.FindWithQuery(supQuery).FirstOrDefault());
        }
Beispiel #5
0
 public void AttributesTest()
 {
     using (var x = new AttributeTest()) {
         var shape1 = new long [] { 1, 3 };
         var shape2 = new long [] { 2, 4, 6 };
         var desc   = x.Init("list(shape)");
         desc.SetAttrShape("v", new long [] [] { shape1, shape2 });
         var op = desc.FinishOperation();
         ExpectMeta(op, "v", 2, TFAttributeType.Shape, 5);
     }
 }
Beispiel #6
0
        public void YZDMS()
        {
            // Arrange
            AttributeTest attributeTest = new AttributeTest();

            // Act
            ExampleMsg msg = MsgCtrl.Allocate <ExampleMsg>();

            MsgCtrl.Send(msg);

            // Assert
            Assert.AreEqual(1, attributeTest.ReceivedMessages);
        }
Beispiel #7
0
        public void DEZSX()
        {
            // Arrange
            AttributeTest attributeTest = new AttributeTest();

            // Act
            attributeTest.Unregister();
            ExampleMsg msg = MsgCtrl.Allocate <ExampleMsg>();

            MsgCtrl.Send(msg);

            // Assert
            Assert.AreEqual(0, attributeTest.ReceivedMessages);
        }
    static void Main(string[] args)
    {
        AttributeTest t = new AttributeTest();

        t.NewMethod();


        Type t1 = typeof(t);

        Attribute[] attrs;
        Attribute.GetCustomAttributes(typeof(t1));
        foreach (Attribute a in attrs)
        {
            Console.Out.WriteLine((a as CopyrightAttribute).Signature);
        }
    }
Beispiel #9
0
        public static void Init()
        {
            var           db = GetInstance();
            AttributeTest a  = new AttributeTest()
            {
                Name = "attr"
            };

            db.Insertable(a).AS("student").ExecuteCommand();
            var list  = db.Queryable <AttributeTest>().AS("student").ToList();
            var list2 = db.Queryable <AttributeTest>().AS("student").Select(it => new AttributeTest()
            {
                Aid = it.Aid + 1, CreateTime = DateTime.Now, Name = it.Name
            }).ToList();
            var s = new AttributeTest2()
            {
                Aid = 1, AName = "a", CreateTime = DateTime.Now
            };
            var count = db.Updateable(s).UpdateColumns(it => new { it.CreateTime, it.AName }).Where(it => it.Aid == 100).ExecuteCommand();
        }
        public static CategoriaPreguntaModelCollection GetCategoriasPregunta(int idFormulario)
        {
            //Consultas las categorias de preguntas filtradas por actividad
            Query supQuery = new Query();
            supQuery.Distinct = true;
            supQuery.Select("pr.idCategoriaPregunta");
            supQuery.From("Pregunta", "pr");
            supQuery.Join("PreguntaFormulario", "pf", "pf.idPregunta", "pr.idPregunta");
            supQuery.Where(new AttributeTest("pf.idFormulario", idFormulario, AttributeTest.EQUAL));

            /* ************* */
            Query filterQuery = new Query();
            AttributeTest test = new AttributeTest();
            test.Attribute = "idCategoriaPregunta";
            test.Value = supQuery;
            test.Operator = AttributeTest.IN;
            filterQuery.Where(test);

            return new CategoriaPreguntaModelCollection(CategoriaPregunta.FindWithQuery(filterQuery));
        }
Beispiel #11
0
        /// <summary>
        /// Validate an attribute test.
        /// </summary>
        /// <param name="e">
        ///            is the expression. </param>
        /// <returns> null. </returns>
        // XXX NO CHECK ?
        public virtual object visit(AttributeTest e)
        {
            QName name = e.name();

            if (name != null)
            {
                if (!expandItemQName(name))
                {
                    reportBadPrefix(name.prefix());
                }
            }

            name = e.type();
            if (name != null)
            {
                if (!expandItemTypeQName(name))
                {
                    reportBadPrefix(name.prefix());
                }
            }
            return(null);
        }
Beispiel #12
0
        public static PreguntaFormularioModelCollection GetPreguntas(FormularioModel formulario)
        {
            //Query subSupQuery = new Query();
            //subSupQuery.Distinct = true;
            //subSupQuery.Select("pf.idPregunta");
            //subSupQuery.From("PreguntaFormulario", "pf");
            //subSupQuery.Where(new AttributeTest("pf.idFormulario", idFormulario, AttributeTest.EQUAL));

            //AttributeTest filterTest = new AttributeTest();
            //filterTest.Attribute = "idPregunta";
            //filterTest.Value = subSupQuery;
            //filterTest.Operator = AttributeTest.IN;

            //SortCriteria sort = new SortCriteria();
            //sort.Add("idPregunta", (int)SortOrderType.Ascending);

            //Query filterQuery = new Query();
            //filterQuery.Where(filterTest);
            //filterQuery.SortCriteria = sort;

            // Pregunta.FindWithQuery(filterQuery)

            AttributeTest filterTest = new AttributeTest();

            filterTest.Attribute = "idFormulario";
            filterTest.Value     = formulario.IdFormulario;
            filterTest.Operator  = AttributeTest.EQUAL;

            SortCriteria sort = new SortCriteria();

            sort.Add("idPregunta", (int)SortOrderType.Ascending);

            Query filterQuery = new Query();

            filterQuery.Where(filterTest);
            filterQuery.SortCriteria = sort;

            return(new PreguntaFormularioModelCollection(PreguntaFormulario.FindWithQuery(filterQuery)));
        }
Beispiel #13
0
        public static CategoriaPreguntaModelCollection GetCategoriasPregunta(int idFormulario)
        {
            //Consultas las categorias de preguntas filtradas por actividad
            Query supQuery = new Query();

            supQuery.Distinct = true;
            supQuery.Select("pr.idCategoriaPregunta");
            supQuery.From("Pregunta", "pr");
            supQuery.Join("PreguntaFormulario", "pf", "pf.idPregunta", "pr.idPregunta");
            supQuery.Where(new AttributeTest("pf.idFormulario", idFormulario, AttributeTest.EQUAL));

            /* ************* */
            Query         filterQuery = new Query();
            AttributeTest test        = new AttributeTest();

            test.Attribute = "idCategoriaPregunta";
            test.Value     = supQuery;
            test.Operator  = AttributeTest.IN;
            filterQuery.Where(test);

            return(new CategoriaPreguntaModelCollection(CategoriaPregunta.FindWithQuery(filterQuery)));
        }
        public static PreguntaFormularioModelCollection GetPreguntas(FormularioModel formulario)
        {
            //Query subSupQuery = new Query();
            //subSupQuery.Distinct = true;
            //subSupQuery.Select("pf.idPregunta");
            //subSupQuery.From("PreguntaFormulario", "pf");
            //subSupQuery.Where(new AttributeTest("pf.idFormulario", idFormulario, AttributeTest.EQUAL));

            //AttributeTest filterTest = new AttributeTest();
            //filterTest.Attribute = "idPregunta";
            //filterTest.Value = subSupQuery;
            //filterTest.Operator = AttributeTest.IN;

            //SortCriteria sort = new SortCriteria();
            //sort.Add("idPregunta", (int)SortOrderType.Ascending);

            //Query filterQuery = new Query();
            //filterQuery.Where(filterTest);
            //filterQuery.SortCriteria = sort;

            // Pregunta.FindWithQuery(filterQuery)

            AttributeTest filterTest = new AttributeTest();
            filterTest.Attribute = "idFormulario";
            filterTest.Value = formulario.IdFormulario;
            filterTest.Operator = AttributeTest.EQUAL;

            SortCriteria sort = new SortCriteria();
            sort.Add("idPregunta", (int)SortOrderType.Ascending);

            Query filterQuery = new Query();
            filterQuery.Where(filterTest);
            filterQuery.SortCriteria = sort;

            return new PreguntaFormularioModelCollection(PreguntaFormulario.FindWithQuery(filterQuery));
        }
Beispiel #15
0
 /// <param name="e">
 ///            is the attribute test. </param>
 /// <returns> e </returns>
 public virtual object visit(AttributeTest e)
 {
     return(e);
 }
Beispiel #16
0
        public static void Main(string[] args)
        {
//            GenericTest.MainTest();
//            ReflectionTest.MainTest();
            AttributeTest.MainTest();
        }
Beispiel #17
0
        public static DireccionEntregaModelCollection BuscarClientes(String cuit, String razonSocial, String apies)
        {
            Query supQuery = new Query();
            
            AttributeTest testCUIT = new AttributeTest();
            testCUIT.Attribute = "CUIT";
            testCUIT.Operator = AttributeTest.LIKE;
            testCUIT.Value = "%" + cuit + "%" ;

            AttributeTest testRazonSocial = new AttributeTest();
            testRazonSocial.Attribute = "razonSocial";
            testRazonSocial.Operator = AttributeTest.LIKE;
            testRazonSocial.Value = "%" + razonSocial + "%";

            AttributeTest testAPIES = new AttributeTest();
            testRazonSocial.Attribute = "APIES";
            testRazonSocial.Operator = AttributeTest.LIKE;
            testRazonSocial.Value = "%" + apies + "%";

            //AttributeTest testCuentaLP2 = new AttributeTest();
            //testCuentaLP2.setAttribute("cuentaLP2");
            //testCuentaLP2.setOperator(AttributeTest.EQUAL);
            //testCuentaLP2.setValue(nroCuenta);

            //AttributeTest testCuentaQP1 = new AttributeTest();
            //testCuentaQP1.setAttribute("cuentaQP1");
            //testCuentaQP1.setOperator(AttributeTest.EQUAL);
            //testCuentaQP1.setValue(nroCuenta);

            //AttributeTest testCuentaSGC = new AttributeTest();
            //testCuentaSGC.setAttribute("cuentaSGC");
            //testCuentaSGC.setOperator(AttributeTest.EQUAL);
            //testCuentaSGC.setValue(nroCuenta);

            //AttributeTest testDummy = new AttributeTest();
            //testDummy.setAttribute("CUIT");
            //testDummy.setOperator(AttributeTest.NOT_EQUAL);
            //testDummy.setValue("");


            CompositeTest where = new CompositeTest();
            where.Operator = CompositeTest.AND;

            if (cuit.Trim().Length != 0) where.Add(testCUIT);
            if (razonSocial.Trim().Length != 0) where.Add(testRazonSocial);
            if (apies.Trim().Length > 0) where.Add(testAPIES);
            //if (nroCuenta != null && nroCuenta.length() > 0 && tipoCuenta != null && tipoCuenta.length() > 0)
            //{
            //    if (tipoCuenta.equals("LP2"))
            //        where.add(testCuentaLP2);
            //    if (tipoCuenta.equals("QP1"))
            //        where.add(testCuentaQP1);
            //    if (tipoCuenta.equals("SGC"))
            //        where.add(testCuentaSGC);
            //}

            if(where.Operands.Count > 0)
                supQuery.Where(where);

            //SortCriteria sort = new SortCriteria();
            //sort.add("CUIT", SortOrderType.ASCENDING);
            //sort.add("razonSocial", SortOrderType.ASCENDING);

            //supQuery.setSortCriteria(sort);

            GenericList<DireccionEntrega> result = DireccionEntrega.FindWithQuery(supQuery);

            return new DireccionEntregaModelCollection(result);
        }
        public static DireccionEntregaModelCollection BuscarClientes(String cuit, String razonSocial, String apies)
        {
            Query supQuery = new Query();

            AttributeTest testCUIT = new AttributeTest();

            testCUIT.Attribute = "CUIT";
            testCUIT.Operator  = AttributeTest.LIKE;
            testCUIT.Value     = "%" + cuit + "%";

            AttributeTest testRazonSocial = new AttributeTest();

            testRazonSocial.Attribute = "razonSocial";
            testRazonSocial.Operator  = AttributeTest.LIKE;
            testRazonSocial.Value     = "%" + razonSocial + "%";

            AttributeTest testAPIES = new AttributeTest();

            testRazonSocial.Attribute = "APIES";
            testRazonSocial.Operator  = AttributeTest.LIKE;
            testRazonSocial.Value     = "%" + apies + "%";

            //AttributeTest testCuentaLP2 = new AttributeTest();
            //testCuentaLP2.setAttribute("cuentaLP2");
            //testCuentaLP2.setOperator(AttributeTest.EQUAL);
            //testCuentaLP2.setValue(nroCuenta);

            //AttributeTest testCuentaQP1 = new AttributeTest();
            //testCuentaQP1.setAttribute("cuentaQP1");
            //testCuentaQP1.setOperator(AttributeTest.EQUAL);
            //testCuentaQP1.setValue(nroCuenta);

            //AttributeTest testCuentaSGC = new AttributeTest();
            //testCuentaSGC.setAttribute("cuentaSGC");
            //testCuentaSGC.setOperator(AttributeTest.EQUAL);
            //testCuentaSGC.setValue(nroCuenta);

            //AttributeTest testDummy = new AttributeTest();
            //testDummy.setAttribute("CUIT");
            //testDummy.setOperator(AttributeTest.NOT_EQUAL);
            //testDummy.setValue("");


            CompositeTest where = new CompositeTest();
            where.Operator      = CompositeTest.AND;

            if (cuit.Trim().Length != 0)
            {
                where.Add(testCUIT);
            }
            if (razonSocial.Trim().Length != 0)
            {
                where.Add(testRazonSocial);
            }
            if (apies.Trim().Length > 0)
            {
                where.Add(testAPIES);
            }
            //if (nroCuenta != null && nroCuenta.length() > 0 && tipoCuenta != null && tipoCuenta.length() > 0)
            //{
            //    if (tipoCuenta.equals("LP2"))
            //        where.add(testCuentaLP2);
            //    if (tipoCuenta.equals("QP1"))
            //        where.add(testCuentaQP1);
            //    if (tipoCuenta.equals("SGC"))
            //        where.add(testCuentaSGC);
            //}

            if (where.Operands.Count > 0)
            {
                supQuery.Where(where);
            }

            //SortCriteria sort = new SortCriteria();
            //sort.add("CUIT", SortOrderType.ASCENDING);
            //sort.add("razonSocial", SortOrderType.ASCENDING);

            //supQuery.setSortCriteria(sort);

            GenericList <DireccionEntrega> result = DireccionEntrega.FindWithQuery(supQuery);

            return(new DireccionEntregaModelCollection(result));
        }
Beispiel #19
0
        public static NegocioModelCollection GetNegociosBySegmento(int idSegmento)
        {
            Query supQuery = new Query().Where(AttributeTest.Equal("idSegmento", idSegmento.ToString()));

            return(new NegocioModelCollection(Negocio.FindWithQuery(supQuery)));
        }
Beispiel #20
0
        public static MotivoModelCollection GetMotivosByIDTipoInteraccion(int idTipoInteraccion)
        {
            Query supQuery = new Query().Where(AttributeTest.Equal("idTipoInteraccion", idTipoInteraccion.ToString()));

            return(new MotivoModelCollection(Motivo.FindWithQuery(supQuery)));
        }