Exemplo n.º 1
0
        public void CompareWorkItemType_SourceAndTargetEmptyTest()
        {
            bool          expected     = false;
            ISet <string> sourceFields = new HashSet <string>(StringComparer.OrdinalIgnoreCase);
            ISet <string> targetFields = new HashSet <string>(StringComparer.OrdinalIgnoreCase);

            IValidationContext    context  = new ValidationContext();
            ValidateWorkItemTypes instance = new ValidateWorkItemTypes();
            bool actual = instance.CompareWorkItemType(context, "Bug", sourceFields, targetFields);

            Assert.AreEqual(expected, actual);
        }
Exemplo n.º 2
0
        public void CompareWorkItemType_SameSourceAndTargetWorkItemTypesAndFieldsIgnoreCaseTest()
        {
            bool expected = true;

            ISet <string> sourceFields = new HashSet <string>(StringComparer.OrdinalIgnoreCase)
            {
                "System.Id", "System.AREAPATH"
            };
            ISet <string> targetFields = new HashSet <string>(StringComparer.OrdinalIgnoreCase)
            {
                "System.id", "System.areapath"
            };

            IValidationContext context = new ValidationContext();

            context.SourceFields.TryAdd("System.Id", new WorkItemField {
                ReferenceName = "System.Id", Type = FieldType.Integer
            });
            context.SourceFields.TryAdd("System.AreaPath", new WorkItemField()
            {
                ReferenceName = "Area", Type = FieldType.TreePath
            });
            context.SourceFields.TryAdd("Acceptance Criteria", new WorkItemField()
            {
                ReferenceName = "Acceptance Criteria", Type = FieldType.Html
            });
            context.TargetFields.TryAdd("SYSTEM.ID", new WorkItemField {
                ReferenceName = "System.Id", Type = FieldType.Integer
            });
            context.TargetFields.TryAdd("system.areapath", new WorkItemField()
            {
                ReferenceName = "Area", Type = FieldType.TreePath
            });
            context.TargetFields.TryAdd("Acceptance Criteria", new WorkItemField()
            {
                ReferenceName = "Acceptance Criteria", Type = FieldType.Html
            });
            context.TargetFields.TryAdd("System.Title", new WorkItemField()
            {
                ReferenceName = "System.Title", Type = FieldType.String
            });

            ValidateWorkItemTypes instance = new ValidateWorkItemTypes();
            bool actual = instance.CompareWorkItemType(context, "Bug", sourceFields, targetFields);

            Assert.AreEqual(expected, actual);
        }