Esempio n. 1
0
        public void In_lack_of_timestamps_should_set_finish_to_leader(string name, Func <DateTime?, IFinishCriteria, ITrackOfCheckpoints> factory)
        {
            var def   = RoundDef.Parse(@"Track
11 12 13
12 11
Rating
F12 2 [0 0]
F11 2 [0 0]
 13 1 [0]");
            var fc    = FinishCriteria.FromForcedFinish();
            var track = def.CreateTrack(factory, fc);

            track.ForceFinish();
            def.VerifyTrack(track, name, false);
            track.ToRoundDefString().Should().Be(def.ToString());
        }
Esempio n. 2
0
        static void Track(string[] args)
        {
            if (args.Length < 2)
            {
                Console.WriteLine("TrackOfCheckpoints benchmark. Supply number of checkpoints in one cycle and number of cycles");
                Console.WriteLine("Example: benchmark.exe track 1000 100");
                return;
            }
            var cps    = int.Parse(args[0]);
            var cycles = int.Parse(args[1]);

            Console.WriteLine($"TrackOfCheckpoints benchmark. Append {cps} checkpoints {cycles} iterations");
            var  incrementalWithCustomSortRunner = new InstanceRunner(() => new TrackOfCheckpoints(new DateTime(1), FinishCriteria.FromForcedFinish()));
            var  cyclicRunner = new InstanceRunner(() => new TrackOfCheckpointsCyclic(new DateTime(1), FinishCriteria.FromForcedFinish()));
            var  runners      = new[] { ("Incremental custom sort", incrementalWithCustomSortRunner), ("cyclic", cyclicRunner) };