示例#1
0
        public void TestSearchOrderField(Enums.ResourceType resourceType, List <string> fieldNames, string order)
        {
            string id = SystemFieldTypeHelper.GetResourceId(resourceType, records, 0); //Get first id

            //Read & verify the field's value
            SystemFieldTypeHelper.VerifyOrderSystemField(resourceType, fieldNames, order, id, recordNum, typeof(DateTime));
        }
        public void TestSearchMultipleSearchConditionUsingMultiField(Enums.ResourceType resourceType, string fieldName1, string fieldName2, string condition1, string condition2)
        {
            Enums.ResourceType referenceResourceType1 = SystemTypeField.FieldResourceTypeMapper[fieldName1];
            Enums.ResourceType referenceResourceType2 = SystemTypeField.FieldResourceTypeMapper[fieldName2];

            string fieldAlias1 = $"{resourceType.ToResourceName()}.{fieldName1}";
            string fieldAlias2 = $"{resourceType.ToResourceName()}.{fieldName2}";

            //User id1 and id2 for first reference resource
            //User id3 and id 4 for second reference resource
            //Ex: Searching with 'Or' condition in P_Client and P_Resume resource
            //P_Client:or=id1:id2 , P_Resume:or=id3:id4
            //Use mid-list of ids (ex: 2 and 4) in recordNum(6) created to make sure there are some of data for verifying correctly.
            string id1 = SystemFieldTypeHelper.GetResourceId(referenceResourceType1, records, 2);
            string id2 = SystemFieldTypeHelper.GetResourceId(referenceResourceType1, records, 4);
            string id3 = SystemFieldTypeHelper.GetResourceId(referenceResourceType2, records, 2);
            string id4 = SystemFieldTypeHelper.GetResourceId(referenceResourceType2, records, 4);

            Dictionary <string, string> parameters = new Dictionary <string, string>()
            {
                { DateTimeValidator.FieldAlias1, fieldAlias1 },
                { DateTimeValidator.FieldAlias2, fieldAlias2 },
                { DateTimeValidator.Condition1, condition1 },
                { DateTimeValidator.Condition2, condition2 },
                { DateTimeValidator.ConditionValue1, id1 },
                { DateTimeValidator.ConditionValue2, id2 },
                { DateTimeValidator.ConditionValue3, id3 },
                { DateTimeValidator.ConditionValue4, id4 },
            };

            //Read & verify the field's value
            SystemFieldTypeHelper.VerifyMultiSearchMultiFieldReferenceResource(resourceType, referenceResourceType1, referenceResourceType2, parameters);
        }
        public void TestSearchMultipleSearchConditionUsing1Field(Enums.ResourceType resourceType, string fieldName, string condition1, string condition2)
        {
            Enums.ResourceType referenceResourceType = SystemTypeField.FieldResourceTypeMapper[fieldName];
            string             fieldAlias            = $"{resourceType.ToResourceName()}.{fieldName}";
            string             id1 = SystemFieldTypeHelper.GetResourceId(referenceResourceType, records, 2);
            string             id2 = SystemFieldTypeHelper.GetResourceId(referenceResourceType, records, 4);

            Dictionary <string, string> parameters = new Dictionary <string, string>()
            {
                { DateTimeValidator.FieldAlias1, fieldAlias },
                { DateTimeValidator.FieldAlias2, fieldAlias },
                { DateTimeValidator.Condition1, condition1 },
                { DateTimeValidator.Condition2, condition2 },
                { DateTimeValidator.ConditionValue1, id1 },
                { DateTimeValidator.ConditionValue2, id2 },
            };

            //Read & verify the field's value
            SystemFieldTypeHelper.VerifyMultiSearchSingleFieldReferenceResource(resourceType, referenceResourceType, parameters);
        }