/Atlassian.Jira.Test/CustomFieldTest.cs
C# | 43 lines | 38 code | 3 blank | 2 comment | 0 complexity | da59dc5f9bd6aae27c8df4109398c328 MD5 | raw file
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using Xunit;
- using Atlassian.Jira.Remote;
- using Moq;
-
- namespace Atlassian.Jira.Test
- {
- public class CustomFieldTest
- {
- [Fact]
- public void Name_ShouldRetriveValueFromRemote()
- {
- //arrange
- var jira = TestableJira.Create();
- jira.SoapService
- .Setup(c => c.GetIssuesFromJqlSearch(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<int>()))
- .Returns(new RemoteIssue[]
- {
- new RemoteIssue() { key = "123" }
- });
- jira.SoapService.Setup(c => c.GetFieldsForEdit(It.IsAny<string>(), "123")).Returns(new RemoteField[] {
- new RemoteField(){ id="123", name= "CustomField" }});
-
- var issue = new RemoteIssue()
- {
- project = "bar",
- key = "foo",
- customFieldValues = new RemoteCustomFieldValue[]{
- new RemoteCustomFieldValue(){
- customfieldId = "123",
- values = new string[] {"abc"}
- }
- }
- }.ToLocal(jira);
-
- //assert
- Assert.Equal("CustomField", issue.CustomFields[0].Name);
- }
- }
- }