BelhardTraining.Benchmark.Core.ProgramBase.GetBenchmarkCompetition C# (CSharp) Метод

GetBenchmarkCompetition() публичный Метод

public GetBenchmarkCompetition ( string benchmarkId ) : BelhardBenchmarkCompetition
benchmarkId string
Результат BelhardBenchmarkCompetition
        public BelhardBenchmarkCompetition GetBenchmarkCompetition(string benchmarkId)
        {
            var benchmarks = GetBenhmarkList();

            var competition = new BelhardBenchmarkCompetition();
            foreach (var tuple in benchmarks)
            {
                string id = tuple.Item1;
                Action benchmark = tuple.Item3;
                string comment = tuple.Item2;

                if (benchmarkId == null)
                {
                    competition.AddTask(comment, benchmark);
                }
                else if (string.Equals(benchmarkId, id, StringComparison.OrdinalIgnoreCase))
                {
                    competition.AddTask(comment, benchmark);
                    break;
                }
            }
            return competition;
        }