Beispiel #1
0
        public void RedmineIssues_ShouldClone()
        {
            Issue issueToClone, clonedIssue;

            issueToClone              = new Issue();
            issueToClone.Subject      = issueToCloneSubject;
            issueToClone.CustomFields = new List <IssueCustomField>();

            issueToClone.CustomFields.Add(new IssueCustomField
            {
                Id     = issueToCloneCustomFieldId,
                Values = new List <CustomFieldValue> {
                    new CustomFieldValue {
                        Info = issueToCloneCustomFieldValue
                    }
                }
            });

            clonedIssue = (Issue)issueToClone.Clone();
            clonedIssue.CustomFields.Add(new IssueCustomField
            {
                Id     = clonedIssueCustomFieldId,
                Values = new List <CustomFieldValue> {
                    new CustomFieldValue {
                        Info = clonedIssueCustomFieldValue
                    }
                }
            });

            Assert.IsTrue(issueToClone.CustomFields.Count != clonedIssue.CustomFields.Count);
        }
Beispiel #2
0
        public void Should_Clone_Issue()
        {
            var issueToClone = new Issue
            {
                Subject      = ISSUE_TO_CLONE_SUBJECT,
                CustomFields = new List <IssueCustomField>
                {
                    new IssueCustomField
                    {
                        Id     = ISSUE_TO_CLONE_CUSTOM_FIELD_ID,
                        Values =
                            new List <CustomFieldValue> {
                            new CustomFieldValue {
                                Info = ISSUE_TO_CLONE_CUSTOM_FIELD_VALUE
                            }
                        }
                    }
                }
            };


            var clonedIssue = (Issue)issueToClone.Clone();

            clonedIssue.CustomFields.Add(new IssueCustomField
            {
                Id     = CLONED_ISSUE_CUSTOM_FIELD_ID,
                Values = new List <CustomFieldValue> {
                    new CustomFieldValue {
                        Info = CLONED_ISSUE_CUSTOM_FIELD_VALUE
                    }
                }
            });

            Assert.IsTrue(issueToClone.CustomFields.Count != clonedIssue.CustomFields.Count);
        }
Beispiel #3
0
        public void Should_Clone_Issue()
        {
            const string ISSUE_TO_CLONE_SUBJECT            = "Issue to clone";
            const int    ISSUE_TO_CLONE_CUSTOM_FIELD_ID    = 13;
            const string ISSUE_TO_CLONE_CUSTOM_FIELD_VALUE = "Issue to clone custom field value";
            const int    CLONED_ISSUE_CUSTOM_FIELD_ID      = 13;
            const string CLONED_ISSUE_CUSTOM_FIELD_VALUE   = "Cloned issue custom field value";

            var issueToClone = new Issue
            {
                Subject      = ISSUE_TO_CLONE_SUBJECT,
                CustomFields = new List <IssueCustomField>
                {
                    new IssueCustomField
                    {
                        Id     = ISSUE_TO_CLONE_CUSTOM_FIELD_ID,
                        Values =
                            new List <CustomFieldValue> {
                            new CustomFieldValue {
                                Info = ISSUE_TO_CLONE_CUSTOM_FIELD_VALUE
                            }
                        }
                    }
                }
            };


            var clonedIssue = (Issue)issueToClone.Clone();

            clonedIssue.CustomFields.Add(new IssueCustomField
            {
                Id     = CLONED_ISSUE_CUSTOM_FIELD_ID,
                Values = new List <CustomFieldValue> {
                    new CustomFieldValue {
                        Info = CLONED_ISSUE_CUSTOM_FIELD_VALUE
                    }
                }
            });

            Assert.True(issueToClone.CustomFields.Count != clonedIssue.CustomFields.Count);
        }
Beispiel #4
0
        public void Should_Clone_Issue()
        {
            const string ISSUE_TO_CLONE_SUBJECT            = "Issue to clone";
            const int    ISSUE_TO_CLONE_CUSTOM_FIELD_ID    = 13;
            const string ISSUE_TO_CLONE_CUSTOM_FIELD_VALUE = "Issue to clone custom field value";
            const int    CLONED_ISSUE_CUSTOM_FIELD_ID      = 13;
            const string CLONED_ISSUE_CUSTOM_FIELD_VALUE   = "Cloned issue custom field value";

            var icfc = (IssueCustomField)IdentifiableName.Create(ISSUE_TO_CLONE_CUSTOM_FIELD_ID);

            icfc.Values = new List <CustomFieldValue> {
                new CustomFieldValue {
                    Info = ISSUE_TO_CLONE_CUSTOM_FIELD_VALUE
                }
            };

            var issueToClone = new Issue
            {
                Subject      = ISSUE_TO_CLONE_SUBJECT,
                CustomFields = new List <IssueCustomField>()
                {
                    icfc
                }
            };

            var clonedIssue = (Issue)issueToClone.Clone();

            var icf = (IssueCustomField)IdentifiableName.Create(CLONED_ISSUE_CUSTOM_FIELD_ID);

            icf.Values = new List <CustomFieldValue> {
                new CustomFieldValue {
                    Info = CLONED_ISSUE_CUSTOM_FIELD_VALUE
                }
            };

            clonedIssue.CustomFields.Add(icf);

            Assert.True(issueToClone.CustomFields.Count != clonedIssue.CustomFields.Count);
        }
Beispiel #5
0
        public void Should_Clone_Issue()
        {
            var issueToClone = new Issue
            {
                Subject = ISSUE_TO_CLONE_SUBJECT,
                CustomFields = new List<IssueCustomField>
                {
                    new IssueCustomField
                    {
                        Id = ISSUE_TO_CLONE_CUSTOM_FIELD_ID,
                        Values =
                            new List<CustomFieldValue> {new CustomFieldValue {Info = ISSUE_TO_CLONE_CUSTOM_FIELD_VALUE}}
                    }
                }
            };


            var clonedIssue = (Issue)issueToClone.Clone();
            clonedIssue.CustomFields.Add(new IssueCustomField
            {
                Id = CLONED_ISSUE_CUSTOM_FIELD_ID,
                Values = new List<CustomFieldValue> { new CustomFieldValue { Info = CLONED_ISSUE_CUSTOM_FIELD_VALUE } }
            });

            Assert.IsTrue(issueToClone.CustomFields.Count != clonedIssue.CustomFields.Count);
        }
Beispiel #6
0
        public void RedmineIssues_ShouldClone()
        {
            Issue issueToClone, clonedIssue;
            issueToClone = new Issue();
            issueToClone.Subject = issueToCloneSubject;
            issueToClone.CustomFields = new List<IssueCustomField>();
            
            issueToClone.CustomFields.Add(new IssueCustomField
            {
                Id = issueToCloneCustomFieldId,
                Values = new List<CustomFieldValue> {new CustomFieldValue { Info = issueToCloneCustomFieldValue }}
            });
           
            clonedIssue = (Issue)issueToClone.Clone();
            clonedIssue.CustomFields.Add(new IssueCustomField
            {
                Id = clonedIssueCustomFieldId,
                Values = new List<CustomFieldValue> {new CustomFieldValue { Info = clonedIssueCustomFieldValue }}
            });

            Assert.IsTrue(issueToClone.CustomFields.Count != clonedIssue.CustomFields.Count);
        }