Пример #1
0
        private static IEnumerable <TestCaseData> BulkCreateCombineApplicationFieldTestCasesData()
        {
            var failedCases = new string[] { InputType.Date.ToString(), InputType.Age.ToString(), "Option" };

            foreach (var entry in Enum.GetValues(typeof(Entries)))
            {
                foreach (ResourceId resource in Utils.Resources())
                {
                    var item = FieldsDictionary[resource];
                    for (var i = 0; i < ApplicationFields.Count; i++)
                    {
                        for (var j = i + 1; j < ApplicationFields.Count; j++)
                        {
                            var firstFieldName  = ApplicationFields.Keys.ElementAt(i).ToString();
                            var secondFieldName = ApplicationFields.Keys.ElementAt(j).ToString();

                            var firstFieldType  = BulkCombineFields.GetFieldTypeByFieldName(resource, firstFieldName);
                            var secondFieldType = BulkCombineFields.GetFieldTypeByFieldName(resource, secondFieldName);
                            var testCaseData    = new TestCaseData(entry, resource, firstFieldName, secondFieldName).SetDescription($"Bulk create with {resource} resource and {firstFieldName},{secondFieldName} fields");

                            if (firstFieldType.ToString().ContainsStrings(failedCases) || secondFieldType.ToString().ContainsStrings(failedCases))
                            {
                                testCaseData.Bug("45167,45169");
                            }
                            if (resource == ResourceId.Contract || resource == ResourceId.Activity || resource == ResourceId.Sales)
                            {
                                testCaseData.Bug("45172");
                            }
                            yield return(testCaseData);
                        }
                    }
                }
            }
        }
Пример #2
0
        public void TestBulkCreateEntriesMergeSystemFieldValid(BulkHelpers.Entries entry, ResourceId resource, BulkHelpers.RecordTypes recordType, string fieldName)
        {
            var fieldValue = BulkHelpers.DefaultValueFieldTypes[BulkCombineFields.GetFieldTypeByFieldName(resource, fieldName)](RecordsCreator, resource, fieldName, UserIds.Data);

            BulkHelpers.PerformBulkCreateTests(entry, resource, new Dictionary <string, string> {
                [fieldName] = fieldValue
            }, RecordsCreator, recordType);
        }
Пример #3
0
        public void TestBulkCreateEntriesFieldApplicationFIeldValid(Entries entry, ResourceId resource, string fieldName)
        {
            var fieldValue = DefaultValueFieldTypes[BulkCombineFields.GetFieldTypeByFieldName(resource, fieldName)](RecordsCreator, resource, fieldName, UserIds.Data);

            PerformBulkCreateTests(entry, resource, new Dictionary <string, string> {
                [fieldName] = fieldValue
            }, RecordsCreator);
        }
Пример #4
0
        public void TestBulkUpdateCombineApplicationFieldValid(BulkHelpers.RecordTypes record, BulkHelpers.Filters filter, ResourceId resource, string firstFieldName, string secondFieldName)
        {
            var bulkCombineFields = new BulkCombineFields(record, filter, resource, new List <string> {
                firstFieldName, secondFieldName
            }, RecordsCreator, UserIds);

            bulkCombineFields.PerformCombineTwoFieldsTests();
        }
Пример #5
0
        public void TestBulkCreateEntriesFieldCombineSystemFieldThirdResourceValid(BulkHelpers.Entries entry, ResourceId resource, string firstFieldName, string secondFieldName)
        {
            var firstFieldValue  = BulkHelpers.DefaultValueFieldTypes[BulkCombineFields.GetFieldTypeByFieldName(resource, firstFieldName)](RecordsCreator, resource, firstFieldName, UserIds.Data);
            var secondFieldValue = BulkHelpers.DefaultValueFieldTypes[BulkCombineFields.GetFieldTypeByFieldName(resource, secondFieldName)](RecordsCreator, resource, secondFieldName, UserIds.Data);

            BulkHelpers.PerformBulkCreateTests(entry, resource, new Dictionary <string, string> {
                [firstFieldName] = firstFieldValue, [secondFieldName] = secondFieldValue
            }, RecordsCreator);
        }
Пример #6
0
        public void TestBulkUpdateCombineUserFieldValid(RecordTypes record, Filters filter, ResourceId resource, InputType firstFieldType, InputType secondFieldType)
        {
            var firstFieldName    = FieldsCreator.Data[$"{resource}-{firstFieldType.ToString()}"].Field.Name;
            var secondFieldName   = FieldsCreator.Data[$"{resource}-{secondFieldType.ToString()}"].Field.Name;
            var bulkCombineFields = new BulkCombineFields(record, filter, resource, new List <string> {
                firstFieldName, secondFieldName
            }, RecordsCreator, UserIds, new List <InputType> {
                firstFieldType, secondFieldType
            });

            bulkCombineFields.PerformCombineTwoFieldsTests();
        }
Пример #7
0
        private static IEnumerable <TestCaseData> GenerateTestCaseData(List <ResourceId> resources)
        {
            foreach (var entry in Enum.GetValues(typeof(BulkHelpers.Entries)))
            {
                foreach (var resource in resources)
                {
                    var item = BulkHelpers.FieldsDictionary[resource];
                    for (var i = 0; i < item.Count; i++)
                    {
                        for (var j = i + 1; j < item.Count; j++)
                        {
                            var firstFieldName  = item.Keys.ElementAt(i).ToString();
                            var secondFieldName = item.Keys.ElementAt(j).ToString();

                            if (!((resource == ResourceId.Activity || resource == ResourceId.Sales ||
                                   resource == ResourceId.Person || resource == ResourceId.Recruiter) && (firstFieldName == "P_PhaseMemo" || secondFieldName == "P_PhaseMemo")))
                            {
                                var firstFieldType  = BulkCombineFields.GetFieldTypeByFieldName(resource, firstFieldName);
                                var secondFieldType = BulkCombineFields.GetFieldTypeByFieldName(resource, secondFieldName);
                                var testCaseData    = new TestCaseData(entry, resource, firstFieldName, secondFieldName).SetDescription($"Bulk create with {resource} resource and {firstFieldName},{secondFieldName} fields");

                                if (firstFieldType == BulkHelpers.InputType.Number || firstFieldType == BulkHelpers.InputType.Currency ||
                                    secondFieldType == BulkHelpers.InputType.Number || secondFieldType == BulkHelpers.InputType.Currency)
                                {
                                    testCaseData.Bug("45165");
                                }
                                if (firstFieldName.ContainsStrings(failedOptionFields) || secondFieldName.ContainsStrings(failedOptionFields))
                                {
                                    testCaseData.Bug("45167");
                                }
                                if (firstFieldName.ContainsStrings(failedDateFields) || secondFieldName.ContainsStrings(failedDateFields))
                                {
                                    testCaseData.Bug("45169");
                                }
                                if (resource == ResourceId.Process && (firstFieldName.ContainsStrings(failedOwnerFields) || secondFieldName.ContainsStrings(failedOwnerFields)))
                                {
                                    testCaseData.Bug("45170");
                                }
                                if (resource == ResourceId.Contract || resource == ResourceId.Activity || resource == ResourceId.Sales)
                                {
                                    testCaseData.Bug("45172");
                                }
                                yield return(testCaseData);
                            }
                        }
                    }
                }
            }
        }
Пример #8
0
        private static IEnumerable <TestCaseData> GenerateTestCaseData(List <ResourceId> resources)
        {
            foreach (BulkHelpers.RecordTypes record in Enum.GetValues(typeof(BulkHelpers.RecordTypes)))
            {
                foreach (BulkHelpers.Filters filter in Enum.GetValues(typeof(BulkHelpers.Filters)))
                {
                    foreach (var resource in resources)
                    {
                        var item = BulkHelpers.FieldsDictionary[resource];
                        for (var i = 0; i < item.Count; i++)
                        {
                            for (var j = i + 1; j < item.Count; j++)
                            {
                                var firstFieldName  = item.Keys.ElementAt(i).ToString();
                                var secondFieldName = item.Keys.ElementAt(j).ToString();
                                var testCaseData    = new TestCaseData(record, filter, resource, firstFieldName, secondFieldName).SetDescription($"Bulk update with {resource} resource and {firstFieldName},{secondFieldName} fields");
                                var firstFieldType  = BulkCombineFields.GetFieldTypeByFieldName(resource, firstFieldName);
                                var secondFieldType = BulkCombineFields.GetFieldTypeByFieldName(resource, secondFieldName);

                                if (filter == BulkHelpers.Filters.Replace && (firstFieldType == BulkHelpers.InputType.OptionMultipleItems || secondFieldType == BulkHelpers.InputType.OptionMultipleItems))
                                {
                                    testCaseData.Bug("43628");
                                }
                                if ((filter == BulkHelpers.Filters.Append || filter == BulkHelpers.Filters.Replace) &&
                                    ((firstFieldType == BulkHelpers.InputType.SingleLineText || secondFieldType == BulkHelpers.InputType.MultiLinesText) ||
                                     (firstFieldType == BulkHelpers.InputType.MultiLinesText || secondFieldType == BulkHelpers.InputType.SingleLineText)))
                                {
                                    testCaseData.Bug("43629");
                                }
                                if (filter == BulkHelpers.Filters.Append && (firstFieldType == BulkHelpers.InputType.OptionMultipleItems || secondFieldType == BulkHelpers.InputType.OptionMultipleItems))
                                {
                                    testCaseData.Bug("43630");
                                }
                                if (filter == BulkHelpers.Filters.Replace &&
                                    ((firstFieldType == BulkHelpers.InputType.Number || secondFieldType == BulkHelpers.InputType.Number) ||
                                     (firstFieldType == BulkHelpers.InputType.Currency || secondFieldType == BulkHelpers.InputType.Currency)))
                                {
                                    testCaseData.Bug("44019");
                                }
                                if (filter == BulkHelpers.Filters.Merge)
                                {
                                    testCaseData.Bug("43631");
                                }
                                if (firstFieldName == "P_Id" || secondFieldName == "P_Id")
                                {
                                    testCaseData.Bug("43632");
                                }
                                if (firstFieldName == "P_PhaseMemo" || secondFieldName == "P_PhaseMemo")
                                {
                                    testCaseData.Bug("43635");
                                }
                                if ((firstFieldName == "P_Resource" || firstFieldName == "P_ResourceId") || (secondFieldName == "P_Resource" || secondFieldName == "P_ResourceId"))
                                {
                                    testCaseData.Bug("43637");
                                }
                                if (firstFieldName.Contains("Owner") || firstFieldName.Contains("Owner"))
                                {
                                    testCaseData.Bug("44022");
                                }
                                if (filter == BulkHelpers.Filters.Append &&
                                    ((firstFieldType == BulkHelpers.InputType.Number || firstFieldType == BulkHelpers.InputType.Number) ||
                                     (secondFieldType == BulkHelpers.InputType.Currency || secondFieldType == BulkHelpers.InputType.Currency)))
                                {
                                    testCaseData.Bug("43642");
                                }

                                yield return(testCaseData);
                            }
                        }
                    }
                }
            }
        }