Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stubs for GitHub and AzDO, Execute from Http & GitHub #2

Merged
merged 11 commits into from
Apr 7, 2019
Prev Previous commit
Next Next commit
Get enum extension
  • Loading branch information
tbarlow12 committed Apr 6, 2019
commit 38e1d1b41c1d0a51abf403febdff2d251ff45e70
2 changes: 1 addition & 1 deletion TaskBoardAssistant/Adapters/AzDO/Models/AzDOQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public AzDOQuery(Dictionary<string, string> queryParams)
Guid queryId;
Guid.TryParse(queryParams.GetValueOrDefault("queryId"), out queryId);
QueryId = queryId;
WorkItemType = queryParams.GetValueOrDefault("workItemType");
WorkItemType = queryParams.GetEnum<AzDOType>("workItemType");
QueryName = queryParams.GetValueOrDefault("queryName");
QueryName = queryParams.GetValueOrDefault("queryName");
QueryName = queryParams.GetValueOrDefault("queryName");
Expand Down
1 change: 1 addition & 0 deletions TaskBoardAssistant/Adapters/Trello/Models/TrelloCard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public Task AddLabel(ITaskLabel label)
}

public bool IsArchived { get => (bool) Card.IsArchived; set => Card.IsArchived = value; }
public ITaskBoardMember AssignedTo { get => throw new NotImplementedException(); set => throw new NotImplementedException(); }

public Task Archive()
{
Expand Down
6 changes: 6 additions & 0 deletions TaskBoardAssistant/Core/Services/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ namespace TaskBoardAssistant.Core.Services
{
public static class Extensions
{

public static TEnum GetEnum<TEnum>(this IDictionary<string, string> dictionary, string key)
{
return (TEnum)Enum.Parse(typeof(TEnum), dictionary[key], true);
}

public static TValue GetValueOrDefault<TKey, TValue>(this IDictionary<TKey, TValue> dictionary,
TKey key,
TValue defaultValue)
Expand Down
1 change: 1 addition & 0 deletions UnitTests/TestBoardService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using TaskBoardAssistant.Core;
using TaskBoardAssistant.Adapters.Simulators;
using TaskBoardAssistant.Core.Models;
using TaskBoardAssistant.Core.Services;
using TaskBoardAssistant.Core.Services.Resources;
using TaskBoardAssistant.Adapters.Simulators.Services;

Expand Down
1 change: 1 addition & 0 deletions UnitTests/TestListService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using TaskBoardAssistant.Adapters.Simulators;
using TaskBoardAssistant.Core;
using TaskBoardAssistant.Core.Models;
using TaskBoardAssistant.Core.Services;
using TaskBoardAssistant.Core.Services.Resources;

namespace UnitTests
Expand Down