Пример #1
0
        public void OverwriteExistingRootProperty()
        {
            var issue = new JiraService.Issue.Issue
            {
                key    = "TD-7",
                fields = new JiraService.Issue.IssueFields
                {
                    description = "derp",
                    status      = new JiraService.Issue.Field.StatusField
                    {
                        name = "To Do"
                    }
                }
            };

            issue.SetValueByPath("$.key", "TD-6");
            string result = issue.SerializeObject(new Newtonsoft.Json.JsonSerializerSettings
            {
                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore
            });
            var resultantIssue = JsonConvert.DeserializeObject <JiraService.Issue.Issue>(result, new JiraService.Issue.IssueConverter());

            Assert.IsTrue(resultantIssue.key == "TD-6");
            //
            // TODO: Add test logic here
            //
        }
Пример #2
0
        public void WritePropertyOfExistingChild()
        {
            var issue = new JiraService.Issue.Issue
            {
                fields = new JiraService.Issue.IssueFields
                {
                    description = "derp",
                    status      = new JiraService.Issue.Field.StatusField
                    {
                        name = "To Do"
                    }
                }
            };

            issue.SetValueByPath("$.fields.issuetype.name", "Story");
            string result = issue.SerializeObject(new Newtonsoft.Json.JsonSerializerSettings
            {
                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore
            });
            var resultantIssue = JsonConvert.DeserializeObject <JiraService.Issue.Issue>(result, new JiraService.Issue.IssueConverter());

            Assert.IsTrue(resultantIssue.fields.issuetype.name == "Story");
            //
            // TODO: Add test logic here
            //
        }
Пример #3
0
        public void WritePropertyOnEmptyObject()
        {
            var issue = new JiraService.Issue.Issue
            {
            };

            issue.SetValueByPath("$.fields.issuetype.name", "Story");
            string result = issue.SerializeObject(new Newtonsoft.Json.JsonSerializerSettings
            {
                NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore
            });
            var resultantIssue = JsonConvert.DeserializeObject <JiraService.Issue.Issue>(result, new JiraService.Issue.IssueConverter());

            Assert.IsTrue(resultantIssue.fields.issuetype.name == "Story");
            //
            // TODO: Add test logic here
            //
        }