public static void Configure() { ConventionPack conventionPack = new ConventionPack { new IgnoreIfDefaultConvention(true), new IgnoreExtraElementsConvention(true), new CamelCaseElementNameConvention(), new EnumRepresentationConvention(BsonType.String) }; ConventionRegistry.Register("LuduStackConventions", conventionPack, t => true); BsonDefaults.GuidRepresentation = GuidRepresentation.Standard; EntityBaseMap.Configure(); UserProfileMap.Configure(); GameMap.Configure(); UserContentMap.Configure(); UserPreferencesMap.Configure(); FeaturedContentMap.Configure(); GamificationActionMap.Configure(); GamificationLevelMap.Configure(); GamificationMap.Configure(); PollMap.Configure(); BrainstormMap.Configure(); TeamMap.Configure(); JobsMap.Configure(); TranslationMap.Configure(); }
public void TeamMapWithNoStatesShouldNotBeValid() { var invalidMap = new TeamMap { JiraQuery = "project = 'TEST'", OutputFileName = "validname.csv", Workflow = new List <WorkflowMap>() }; TeamMapValidator.IsValid(invalidMap); }
public void RenderEntities() { Color[] c = new Color[TeamMap.Width * TeamMap.Height]; Array.Clear(c, 0, c.Length); foreach (var se in qSeen) { Color cc = se.TeamIndex == TeamIndex ? Color.Blue : Color.Red; c[se.GridPos.Y * TeamMap.Width + se.GridPos.X] = cc; } TeamMap.SetData(c); }
public void TeamMapWithEmptyJiraQueryShouldNotBeValid() { var invalidMap = new TeamMap { JiraQuery = string.Empty, OutputFileName = "validname.csv", Workflow = new List <WorkflowMap>() { new WorkflowMap(new string[] { "ToDo" }, "TODO", StateType.ToDo, "test_issue_type", 1), new WorkflowMap(new string[] { "Doing" }, "DOING", StateType.InProgress, "test_issue_type", 2), new WorkflowMap(new string[] { "Done" }, "DONE", StateType.Done, "test_issue_type", 3) } }; TeamMapValidator.IsValid(invalidMap); }
public void TeamMapWithInvalidFileExtensionShouldNotBeValid() { var invalidMap = new TeamMap { JiraQuery = "project = 'TEST'", OutputFileName = "missing_the_csv", Workflow = new List <WorkflowMap>() { new WorkflowMap(new string[] { "ToDo" }, "TODO", StateType.ToDo, "test_issue_type", 1), new WorkflowMap(new string[] { "Doing" }, "DOING", StateType.InProgress, "test_issue_type", 2), new WorkflowMap(new string[] { "Done" }, "DONE", StateType.Done, "test_issue_type", 3) } }; TeamMapValidator.IsValid(invalidMap); }
public void TeamMapShouldBeValid() { var validMap = new TeamMap { JiraQuery = "project = 'TEST'", OutputFileName = "validname.csv", Workflow = new List <WorkflowMap>() { new WorkflowMap(new string[] { "ToDo" }, "TODO", StateType.ToDo, "test_issue_type", 1), new WorkflowMap(new string[] { "Doing" }, "DOING", StateType.InProgress, "test_issue_type", 2), new WorkflowMap(new string[] { "Done" }, "DONE", StateType.Done, "test_issue_type", 3) } }; Assert.IsTrue(TeamMapValidator.IsValid(validMap)); }
public void TeamMapWithMultipleDoneStatesShouldNotBeValid() { var invalidMap = new TeamMap { JiraQuery = "project = 'TEST'", OutputFileName = "validname.csv", Workflow = new List <WorkflowMap>() { new WorkflowMap(new string[] { "ToDo" }, "TODO", StateType.ToDo, "test_issue_type", 1), new WorkflowMap(new string[] { "Doing" }, "DOING", StateType.InProgress, "test_issue_type", 2), new WorkflowMap(new string[] { "Done" }, "DONE", StateType.Done, "test_issue_type", 3), new WorkflowMap(new string[] { "Done2" }, "DONE_AGAIN", StateType.Done, "test_issue_type", 4) } }; TeamMapValidator.IsValid(invalidMap); }
public void TeamMapWithDifferentMappedStateNamesAcrossIssueTypesShouldNotBeValid() { var invalidMap = new TeamMap { JiraQuery = "project = 'TEST'", OutputFileName = "validname.csv", Workflow = new List <WorkflowMap>() { new WorkflowMap(new string[] { "ToDo" }, "TODO", StateType.ToDo, "test_issue_type", 1), new WorkflowMap(new string[] { "Doing" }, "DOING", StateType.InProgress, "test_issue_type", 2), new WorkflowMap(new string[] { "Done" }, "DONE", StateType.Done, "test_issue_type", 3), new WorkflowMap(new string[] { "ToDo" }, "TODO", StateType.ToDo, "second_issue_type", 1), new WorkflowMap(new string[] { "Doing" }, "DIFFERENT DOING", StateType.InProgress, "second_issue_type", 2), new WorkflowMap(new string[] { "Done" }, "DONE", StateType.Done, "second_issue_type", 3), } }; TeamMapValidator.IsValid(invalidMap); }
public static void Main(string[] args) { // Grab demo file using (var excel = new ExcelPackage( new FileInfo( Path.Combine(new DirectoryInfo(Directory.GetCurrentDirectory()).Parent.Parent.Parent.FullName, "DemoFile", "ExcelDemo.xlsx")))) // If missing replace FileInfo constructor parameter with your own file { // Horizontal Console.WriteLine("Horizontal mapping"); // Get sheet with horizontal mapping var sheet = excel.Workbook.Worksheets.First(); // Get list of teams based on automatically mapping of the header row Console.WriteLine("List of teams based on automatically mapping of the header row"); var teams = sheet.GetRecords <Team>(); foreach (var team in teams) { Console.WriteLine($"{team.Name} - {team.FoundationYear} - {team.Titles}"); } // Get specific record from sheet based on automatically mapping the header row Console.WriteLine("Team based on automatically mapping of the header row"); var teamRec = sheet.GetRecord <Team>(2); Console.WriteLine($"{teamRec.Name} - {teamRec.FoundationYear} - {teamRec.Titles}"); // Remove HeaderRow sheet.DeleteRow(1); // Get list of teams based on mapping using attributes Console.WriteLine("List of teams based on mapping using attributes"); var teamsAttr = sheet.GetRecords <TeamAttributes>(); foreach (var team in teamsAttr) { Console.WriteLine($"{team.Name} - {team.FoundationYear} - {team.Titles}"); } // Get specific record from sheet based on mapping using attributes Console.WriteLine("Team based on mapping using attributes"); var teamAttr = sheet.GetRecord <TeamAttributes>(1); Console.WriteLine($"{teamAttr.Name} - {teamAttr.FoundationYear} - {teamAttr.Titles}"); // Get list of teams based on user created map Console.WriteLine("List of teams based on user created map"); var teamsMap = sheet.GetRecords(TeamMap.Create()); foreach (var team in teamsMap) { Console.WriteLine($"{team.Name} - {team.FoundationYear} - {team.Titles}"); } // Get specific record from sheet based on user created map Console.WriteLine("Team based on user created map"); var teamMap = sheet.GetRecord <Team>(1, TeamMap.Create()); Console.WriteLine($"{teamMap.Name} - {teamMap.FoundationYear} - {teamMap.Titles}"); // Vertical Console.WriteLine("Vertical mapping"); // Get sheet with vertical mapping var vsheet = excel.Workbook.Worksheets.Skip(1).Take(1).First(); // Get list of teams based on automatically mapping of the header row Console.WriteLine("List of teams based on automatically mapping of the header row"); var vteams = vsheet.GetRecords <VTeam>(); foreach (var vteam in vteams) { Console.WriteLine($"{vteam.Name} - {vteam.FoundationYear} - {vteam.Titles}"); } // Get specific record from sheet based on automatically mapping the header row Console.WriteLine("Team based on automatically mapping of the header row"); var vteamRec = vsheet.GetRecord <VTeam>(2); Console.WriteLine($"{vteamRec.Name} - {vteamRec.FoundationYear} - {vteamRec.Titles}"); // Remove HeaderRow vsheet.DeleteColumn(1); // Get list of teams based on mapping using attributes Console.WriteLine("List of teams based on mapping using attributes"); var vteamsAttr = vsheet.GetRecords <VTeamAttributes>(); foreach (var vteam in vteamsAttr) { Console.WriteLine($"{vteam.Name} - {vteam.FoundationYear} - {vteam.Titles}"); } // Get specific record from sheet based on mapping using attributes Console.WriteLine("Team based on mapping using attributes"); var vteamAttr = vsheet.GetRecord <VTeamAttributes>(1); Console.WriteLine($"{vteamAttr.Name} - {vteamAttr.FoundationYear} - {vteamAttr.Titles}"); // Get list of teams based on user created map Console.WriteLine("List of teams based on user created map"); var vteamsMap = vsheet.GetRecords(VTeamMap.Create()); foreach (var vteam in vteamsMap) { Console.WriteLine($"{vteam.Name} - {vteam.FoundationYear} - {vteam.Titles}"); } // Get specific record from sheet based on user created map Console.WriteLine("Team based on user created map"); var vteamMap = vsheet.GetRecord <VTeam>(1, VTeamMap.Create()); Console.WriteLine($"{vteamMap.Name} - {vteamMap.FoundationYear} - {vteamMap.Titles}"); Console.Read(); } }
public JiraStateWriter(TeamMap teamMap, IIssueStore issueStore, IChangelogStore changelogStore) { _teamMap = teamMap; _issueStore = issueStore; _changelogStore = changelogStore; }
public JiraStateWriter(JiraConfig jiraConfig, TeamMap map) { _issueStore = new IssueStore(jiraConfig); _changelogStore = new ChangelogStore(jiraConfig); _teamMap = map; }