Ejemplo n.º 1
0
        public static string FillTestRunsTemplate(bool isAlternateRow, AllRuns testResult, string rowTemplate)
        {
            StringBuilder sbTestres = new StringBuilder();

            string[] statusIcons     = { "a", "ä", "ü", "û" };
            string   Log             = string.Empty;
            string   alternateRowCss = (isAlternateRow ? "ms-Grid-row-ms-bgColor-neutralLighterAlt" : "ms-Grid-row-ms-bgColor-neutralLighter");

            string rootUrl = ConfigurationManager.AppSettings["ida:PostLogoutRedirectUri"];

            if (rootUrl[rootUrl.Length - 1] == '/')
            {
                rootUrl = rootUrl.Remove(rootUrl.Length - 1);
            }

            if (testResult.Log)
            {
                Log = "<a href = \"" + rootUrl + "/TestRuns/PrintLog/" + testResult.TestRunSetId + "\">Log</a>";
            }
            else
            {
                Log = "N/A";
            }

            return(String.Format(rowTemplate, rootUrl, testResult.TestRunSetId, statusIcons[testResult.Status],
                                 testResult.ConfiguratioName,
                                 testResult.CategoryName,
                                 testResult.AppOnly,
                                 testResult.Environment,
                                 GetTestDate(testResult.Testdate),
                                 GetTestDuration(testResult.TestDuration),
                                 testResult.Tests,
                                 testResult.Passed,
                                 testResult.Skipped,
                                 testResult.Failed,
                                 Log,
                                 testResult.GithubBranch,
                                 alternateRowCss));
        }
Ejemplo n.º 2
0
 public WorkoutEvent GetNextRace()
 {
     return(AllRuns.Where(r => r.Date > DateTime.Now).OrderBy(r => r.Date).FirstOrDefault());
 }
Ejemplo n.º 3
0
 public WorkoutEvent GetNextMarathon()
 {
     return(AllRuns.Where(r => r.Date > DateTime.Now && r.Distance.ToMiles(r.Unit.Name) > 26).OrderBy(r => r.Date).FirstOrDefault());
 }
Ejemplo n.º 4
0
 public IEnumerable <WorkoutEvent> GetPastRuns()
 {
     return(AllRuns.Where(r => r.Date.Date <= DateTime.Now.Date));
 }