public void TestGetAllBoards() { var actualBoards = trelloClient.GetAllBoards(testOrgId); Assert.True(actualBoards.Length > 2); var actualOpenBoards = trelloClient.GetOpenBoards(testOrgId); var query1 = actualBoards.Select(x => x.Name); var query2 = actualOpenBoards.Select(x => x.Name); Assert.True(query2.All(i => query1.Contains(i))); }
public IEnumerable <ReportModel> BuildForDirections() { var boards = taskManagerClient.GetAllBoards(organizationName).ToArray(); var directionBoards = boards.Where(b => b.Name.StartsWith("[К]") && b.IsClosed == false); foreach (var directionBoard in directionBoards) { var lists = taskManagerClient.GetBoardLists(directionBoard.Id); var doneList = lists.Count(l => l.Name.Contains("Готово")) == 1 ? lists.First(l => l.Name.Contains("Готово")) : lists.Last(); var listNames = lists.Select(l => l.Name).ToArray(); var listNameToIdIndex = lists.ToDictionary(l => l.Name, l => l.Id); var aggregation = cardsAggregator.Aggregate(doneList); yield return(new ReportModel(directionBoard.Name, Build(aggregation, listNames, listNameToIdIndex))); } }