public void TestEditFieldString() { var mock = new MockJsonServiceClient(); var client = new JiraIssueRestClient(mock, null, null); var issue = JsonResource.Issue_StringCustomField.FromJson <Issue>(); client.EditField(issue, TestCustomFieldName, TestCustomFieldStringValue); // Check the JSON generated for a field update to ensure it matches expected JSON for a string field. Assert.AreEqual("{customfield_1234:[{set:Hello, World!}]}", mock.PutRequest["update"], "Unexpected Json generated for editing a string custom field with no converter."); }
public void TestEditFieldCustomType() { var mock = new MockJsonServiceClient(); var client = new JiraIssueRestClient(mock, null, null); var issue = JsonResource.Issue_StringCustomField.FromJson <Issue>(); var custom = new CustomType(); custom.CustomIntProperty = TestCustomFieldIntValue; custom.CustomStringProperty = TestCustomFieldStringValue; client.EditField(issue, TestCustomFieldName, custom); // Check the JSON generated for a field update to ensure it matches expected JSON for // a custom type field with no converter (this should dump custom type name). Assert.AreEqual( "{customfield_1234:[{set:JIRC.Internal.Tests.Json.CustomType}]}", mock.PutRequest["update"], "Unexpected Json generated for editing a string custom field with no converter."); }