本文整理汇总了C#中LeanKit.API.Client.Library.TransferObjects.Card类的典型用法代码示例。如果您正苦于以下问题:C# Card类的具体用法?C# Card怎么用?C# Card使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Card类属于LeanKit.API.Client.Library.TransferObjects命名空间,在下文中一共展示了Card类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ToCard
public Card ToCard()
{
var card = new Card();
card.Active = Active;
card.ClassOfServiceId = ClassOfServiceId;
card.BlockReason = BlockReason;
card.Description = Description;
card.StartDate = StartDate;
card.DueDate = DueDate;
card.ExternalCardID = ExternalCardID;
card.ExternalSystemName = ExternalSystemName;
card.ExternalSystemUrl = ExternalSystemUrl;
card.Id = Id;
card.Index = Index;
card.IsBlocked = IsBlocked;
card.LaneId = LaneId;
card.Priority = (int) Priority;
card.Size = Size;
card.Tags = Tags;
card.Title = Title;
card.TypeId = TypeId;
card.Version = Version;
card.AssignedUserIds = (AssignedUsers != null) ? AssignedUsers.Select(x => x.AssignedUserId).ToArray() : null;
card.Comments = Comments;
card.HistoryEvents = HistoryEvents;
card.HistoryEvents = HistoryEvents;
card.LastMove = LastMove;
card.LastActivity = LastActivity;
card.LastComment = LastComment;
card.DateArchived = DateArchived;
return card;
}
开发者ID:JohnDMathis,项目名称:LeanKit.API.Client,代码行数:32,代码来源:CardView.cs
示例2: It_should_not_call_unfuddle_to_update_ticket_for_states_it_is_in_or_past
public void It_should_not_call_unfuddle_to_update_ticket_for_states_it_is_in_or_past()
{
Card card2 = new Card() { Id = 2, ExternalSystemName = "Unfuddle", ExternalCardID = "2" };
Card card4 = new Card() { Id = 4, ExternalSystemName = "Unfuddle", ExternalCardID = "4" };
((TestUnfuddle)TestItem).TestUpdateStateOfExternalItem(card2, _mapping.LaneToStatesMap[2], _mapping);
((TestUnfuddle)TestItem).TestUpdateStateOfExternalItem(card4, _mapping.LaneToStatesMap[2], _mapping);
MockRestClient.Verify(x => x.Execute(It.Is<RestRequest>(y => y.Resource.Contains("tickets/2") && y.Method == Method.GET)), Times.Exactly(3));
MockRestClient.Verify(x => x.Execute(It.Is<RestRequest>(y => y.Resource.Contains("tickets/2") && y.Method == Method.PUT)), Times.Exactly(2));
MockRestClient.Verify(x => x.Execute(It.Is<RestRequest>(y => y.Resource.Contains("tickets/4") && y.Method == Method.GET)), Times.Exactly(2));
MockRestClient.Verify(x => x.Execute(It.Is<RestRequest>(y => y.Resource.Contains("tickets/4") && y.Method == Method.PUT)), Times.Exactly(1));
}
开发者ID:JanKinable,项目名称:LeanKit.IntegrationService,代码行数:14,代码来源:UnfuddleSpec.cs
示例3: AddTaskboardCard
public void AddTaskboardCard(Card card, long taskboardId, string wipOverrideReason)
{
//var results = string.IsNullOrEmpty(wipOverrideReason)
// ? _api.AddTaskboardCard(_boardId, taskboardId, card)
// : _api.AddTaskboardCard(_boardId, taskboardId, card, wipOverrideReason);
//_boardLock.EnterWriteLock();
//try {
// //TODO: Figure out what to do for taskboards
// //ApplyBoardChanges(results.BoardVersion, new[] {results.Lane});
//} finally {
// _boardLock.ExitWriteLock();
//}
}
开发者ID:manotejmeka,项目名称:LeanKit.API.Client,代码行数:14,代码来源:LeanKitIntegration.cs
示例4: UpdateTask
public void UpdateTask(Card task, long cardId, string wipOverrideReason)
{
//var results = string.IsNullOrEmpty(wipOverrideReason)
// ? _api.UpdateTask(_boardId, cardId, task)
// : _api.UpdateTask(_boardId, cardId, task, wipOverrideReason);
//TODO: Figure out how to handle taskboards
// CardView cardView = results.CardDTO;
// Lane lane = _board.GetLaneById(cardView.LaneId);
//
//TODO: handle the situation where a card in moved through the Update method
//
// _boardLock.EnterWriteLock();
// try {
// lane.UpdateCard(cardView);
// ApplyBoardChanges(results.BoardVersion, new[] { lane });
// }
// finally {
// _boardLock.ExitWriteLock();
// }
}
开发者ID:manotejmeka,项目名称:LeanKit.API.Client,代码行数:21,代码来源:LeanKitIntegration.cs
示例5: AddTask
public void AddTask(Card task, long cardId)
{
AddTask(task, cardId, string.Empty);
}
开发者ID:manotejmeka,项目名称:LeanKit.API.Client,代码行数:4,代码来源:LeanKitIntegration.cs
示例6: UpdateCard
public virtual void UpdateCard(Card card)
{
UpdateCard(card, string.Empty);
}
开发者ID:manotejmeka,项目名称:LeanKit.API.Client,代码行数:4,代码来源:LeanKitIntegration.cs
示例7: AddCard
public virtual void AddCard(Card card)
{
AddCard(card, string.Empty);
}
开发者ID:manotejmeka,项目名称:LeanKit.API.Client,代码行数:4,代码来源:LeanKitIntegration.cs
示例8: CardUpdated
protected abstract void CardUpdated(Card card, List<string> updatedItems, BoardMapping boardMapping);
开发者ID:ERPDevelopment,项目名称:LeanKit.IntegrationService,代码行数:1,代码来源:TargetBase.cs
示例9: It_should_not_call_github_to_update_pull_if_externalsystemname_does_not_match
public void It_should_not_call_github_to_update_pull_if_externalsystemname_does_not_match()
{
Card card = new Card() {Id = 4, ExternalSystemName = "GitHubby", ExternalCardID = "4|4"};
((TestGitHubPulls) TestItem).TestUpdateStateOfExternalItem(card, _mapping.LaneToStatesMap[2], _mapping);
MockRestClient.Verify(
x => x.Execute(It.Is<RestRequest>(y => y.Resource.Contains("pulls/4") && y.Method == Method.GET)), Times.Never());
MockRestClient.Verify(
x => x.Execute(It.Is<RestRequest>(y => y.Resource.Contains("pulls/4") && y.Method == Method.PATCH)), Times.Never());
}
开发者ID:clickless,项目名称:LeanKit.IntegrationService,代码行数:9,代码来源:GitHubPullsSpec.cs
示例10: It_should_not_call_github_to_update_pull_state_is_already_end_state
public void It_should_not_call_github_to_update_pull_state_is_already_end_state()
{
Card card = new Card() {Id = 2, ExternalSystemName = "GitHub", ExternalCardID = "2|2"};
((TestGitHubPulls) TestItem).TestUpdateStateOfExternalItem(card, _mapping.LaneToStatesMap[2], _mapping);
MockRestClient.Verify(
x => x.Execute(It.Is<RestRequest>(y => y.Resource.Contains("pulls/2") && y.Method == Method.GET)), Times.Exactly(1));
MockRestClient.Verify(
x => x.Execute(It.Is<RestRequest>(y => y.Resource.Contains("pulls/2") && y.Method == Method.PATCH)), Times.Never());
}
开发者ID:clickless,项目名称:LeanKit.IntegrationService,代码行数:9,代码来源:GitHubPullsSpec.cs
示例11: TestUpdateStateOfExternalItem
public void TestUpdateStateOfExternalItem(Card card, List<string> laneStateMap, BoardMapping boardConfig)
{
base.UpdateStateOfExternalItem(card, laneStateMap, boardConfig, true);
}
开发者ID:clickless,项目名称:LeanKit.IntegrationService,代码行数:4,代码来源:GitHubPullsSpec.cs
示例12: It_should_not_call_github_to_update_pull_if_externalsystemname_is_different
public void It_should_not_call_github_to_update_pull_if_externalsystemname_is_different()
{
Card card = new Card();
card.ExternalCardID = "5|5";
card.ExternalSystemName = "GitHubby";
card.Description = "Pull 5";
card.Title = "Pull 5";
((TestGitHubPulls) TestItem).TestCardUpdated(card, new List<string>(), _mapping);
MockRestClient.Verify(
x => x.Execute(It.Is<RestRequest>(y => y.Resource.Contains("pulls/5") && y.Method == Method.GET)), Times.Never());
MockRestClient.Verify(
x => x.Execute(It.Is<RestRequest>(y => y.Resource.Contains("pulls/5") && y.Method == Method.PATCH)), Times.Never());
}
开发者ID:clickless,项目名称:LeanKit.IntegrationService,代码行数:14,代码来源:GitHubPullsSpec.cs
示例13: It_should_not_call_github_to_update_pull_if_no_identified_properties_change
public void It_should_not_call_github_to_update_pull_if_no_identified_properties_change()
{
Card card = new Card();
card.ExternalCardID = "4|4";
card.ExternalSystemName = "GitHub";
card.Description = "Pull 4";
card.Title = "Pull 4";
((TestGitHubPulls) TestItem).TestCardUpdated(card, new List<string>(), _mapping);
MockRestClient.Verify(
x => x.Execute(It.Is<RestRequest>(y => y.Resource.Contains("pulls/4") && y.Method == Method.GET)), Times.Exactly(1));
MockRestClient.Verify(
x => x.Execute(It.Is<RestRequest>(y => y.Resource.Contains("pulls/4") && y.Method == Method.PATCH)), Times.Never());
}
开发者ID:clickless,项目名称:LeanKit.IntegrationService,代码行数:14,代码来源:GitHubPullsSpec.cs
示例14: TestCardUpdated
public void TestCardUpdated(Card card, List<string> updatedItems, BoardMapping boardMapping)
{
base.CardUpdated(card, updatedItems, boardMapping);
}
开发者ID:clickless,项目名称:LeanKit.IntegrationService,代码行数:4,代码来源:GitHubPullsSpec.cs
示例15: It_should_not_call_unfuddle_to_update_ticket_if_externalstatename_does_not_match
public void It_should_not_call_unfuddle_to_update_ticket_if_externalstatename_does_not_match()
{
Card card = new Card() { Id = 5, ExternalSystemName = "Unfuddlest", ExternalCardID = "5" };
((TestUnfuddle)TestItem).TestUpdateStateOfExternalItem(card, _mapping.LaneToStatesMap[2], _mapping);
MockRestClient.Verify(x => x.Execute(It.Is<RestRequest>(y => y.Resource.Contains("tickets/5") && y.Method == Method.GET)), Times.Never());
MockRestClient.Verify(x => x.Execute(It.Is<RestRequest>(y => y.Resource.Contains("tickets/5") && y.Method == Method.PUT)), Times.Never());
}
开发者ID:JanKinable,项目名称:LeanKit.IntegrationService,代码行数:8,代码来源:UnfuddleSpec.cs
示例16: CreateNewItem
protected override void CreateNewItem(Card card, BoardMapping boardMapping)
{
var project = _projectCollectionWorkItemStore.Projects[boardMapping.Identity.TargetName];
var tfsWorkItemType = GetTfsWorkItemType(boardMapping, project.WorkItemTypes, card.TypeId);
var workItemType = project.WorkItemTypes[tfsWorkItemType.Name];
// Note: using the default state
var workItem = new WorkItem(workItemType)
{
Title = card.Title,
Description = card.Description,
};
SetWorkItemPriority(workItem, card.Priority);
if (!string.IsNullOrEmpty(card.DueDate))
{
if (workItem.Fields.Contains("Due Date"))
workItem.Fields["Due Date"].Value = card.DueDate;
}
if (card.AssignedUserIds != null && card.AssignedUserIds.Any())
{
SetAssignedUser(workItem, boardMapping.Identity.LeanKit, card.AssignedUserIds[0]);
}
if (!string.IsNullOrEmpty(boardMapping.IterationPath)) {
workItem.Fields["System.IterationPath"].Value = boardMapping.IterationPath;
}
try
{
Log.Debug("Attempting to create Work Item from Card [{0}]", card.Id);
workItem.Save();
Log.Debug("Created Work Item [{0}] from Card [{1}]", workItem.Id, card.Id);
card.ExternalCardID = workItem.Id.ToString(CultureInfo.InvariantCulture);
card.ExternalSystemName = ServiceName;
if (_projectHyperlinkService != null)
{
card.ExternalSystemUrl = _projectHyperlinkService.GetWorkItemEditorUrl(workItem.Id).ToString();
}
// now that we've created the work item let's try to set it to any matching state defined by lane
var states = boardMapping.LaneToStatesMap[card.LaneId];
if (states != null)
{
UpdateStateOfExternalItem(card, states, boardMapping, true);
}
LeanKit.UpdateCard(boardMapping.Identity.LeanKit, card);
}
catch (ValidationException ex)
{
Log.Error("Unable to create WorkItem from Card [{0}]. ValidationException: {1}", card.Id, ex.Message);
}
catch (Exception ex)
{
Log.Error("Unable to create WorkItem from Card [{0}], Exception: {1}", card.Id, ex.Message);
}
}
开发者ID:ERPDevelopment,项目名称:LeanKit.IntegrationService,代码行数:64,代码来源:Tfs.cs
示例17: UpdateStateOfExternalItem
protected abstract void UpdateStateOfExternalItem(Card card, List<string> states, BoardMapping boardMapping);
开发者ID:ERPDevelopment,项目名称:LeanKit.IntegrationService,代码行数:1,代码来源:TargetBase.cs
示例18: CallWillUpdateCard
public void CallWillUpdateCard()
{
Board board = GetSampleBoard();
_apiMock.Expect(x => x.GetBoard(1)).Return(board);
Card cardToUpdate = new Card
{
Id = 1,
Title = "Card 1 Updated",
LaneId = 1,
Description = "some desc 1",
TypeId = 1,
ExternalCardID = "123"
};
CardUpdateResult result = new CardUpdateResult {BoardVersion = 1, CardDTO = cardToUpdate.ToCardView()};
_apiMock.Expect(x => x.UpdateCard(Arg<long>.Is.Anything, Arg<Card>.Is.Anything)).Return(result);
_integration = new LeanKitIntegration(1, _apiMock);
_integration.ShouldContinue = false;
_integration.StartWatching();
_integration.UpdateCard(cardToUpdate);
Card card = _integration.GetCard(1);
Assert.NotNull(card);
Assert.AreEqual("Card 1 Updated", card.Title);
}
开发者ID:manotejmeka,项目名称:LeanKit.API.Client,代码行数:27,代码来源:LeanKitIntegrationTests.cs
示例19: CreateNewItem
protected abstract void CreateNewItem(Card card, BoardMapping boardMapping);
开发者ID:ERPDevelopment,项目名称:LeanKit.IntegrationService,代码行数:1,代码来源:TargetBase.cs
示例20: CallWillAddCard
public void CallWillAddCard()
{
Board board = GetSampleBoard();
_apiMock.Expect(x => x.GetBoard(1)).Return(board);
Card cardToAdd = new Card
{
Id = 1,
Title = "Card 1 Updated",
LaneId = 1,
Description = "some desc 1",
TypeId = 1,
ExternalCardID = "123"
};
Lane affectedLane = new Lane
{
Id = 1,
Title = "Lane 1",
Cards = new List<CardView>
{
new CardView
{
Id = 1,
Title = "Card 1",
LaneId = 1,
Description = "some desc 1",
Type = new CardType {Id = 1, Name = "Card type 1", IconPath = @"C:\"}
},
new CardView
{
Id = 2,
Title = "Card 2",
LaneId = 1,
Description = "some desc 2",
Type = new CardType {Id = 1, Name = "Card type 1", IconPath = @"C:\"}
},
new CardView
{
Id = 4,
Title = "Card 4",
LaneId = 1,
Description = "some desc 4",
Type = new CardType {Id = 1, Name = "Card type 1", IconPath = @"C:\"}
},
},
};
CardAddResult result = new CardAddResult {BoardVersion = 1, CardId = 4, Lane = affectedLane};
_apiMock.Expect(x => x.AddCard(Arg<long>.Is.Anything, Arg<Card>.Is.Anything)).Return(result);
_integration = new LeanKitIntegration(1, _apiMock);
_integration.ShouldContinue = false;
_integration.StartWatching();
_integration.AddCard(cardToAdd);
Card card = _integration.GetCard(4);
Assert.NotNull(card);
Assert.AreEqual("Card 4", card.Title);
}
开发者ID:manotejmeka,项目名称:LeanKit.API.Client,代码行数:59,代码来源:LeanKitIntegrationTests.cs
注:本文中的LeanKit.API.Client.Library.TransferObjects.Card类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论