Exemplo n.º 1
0
        public void HandTimingsVM()
        {
            string dbFilename = TestUtilities.CreateWorkingFileFrom(testContextInstance.TestDeploymentDir, @"1557MRBR_RH.mdb");
            string hsFilename = @"--Handzeit-Start.txt";
            string hfFilename = @"--Handzeit-Ziel.txt";

            Database db = new Database();

            db.Connect(dbFilename);
            AppDataModel model = new AppDataModel(db);

            FromFileHandTiming hsTiming = new FromFileHandTiming(hsFilename);
            FromFileHandTiming hfTiming = new FromFileHandTiming(hfFilename);

            hsTiming.Connect();
            hfTiming.Connect();

            List <TimingData> hsList = new List <TimingData>(hsTiming.TimingData());
            List <TimingData> hfList = new List <TimingData>(hfTiming.TimingData());


            HandTimingVM htVM = new HandTimingVM(HandTimingVMEntry.ETimeModus.EStartTime);

            htVM.AddRunResults(model.GetRace(0).GetRun(0).GetResultList());
            htVM.AddHandTimings(hsList);
        }
Exemplo n.º 2
0
        public void ReadFromFile()
        {
            FromFileHandTiming ht = new FromFileHandTiming(@"--Handzeit-Start.txt");

            ht.Connect();

            var progress = new Progress <StdProgress>();

            ht.DoProgressReport(progress);

            StdProgress lastProgress    = null;
            int         progressCounter = 0;

            progress.ProgressChanged += (s, e) => { lastProgress = e; progressCounter++; };

            TimeSpan[] shallTime =
            {
                new TimeSpan(0, 8, 48,  0, 570),
                new TimeSpan(0, 9, 32, 56, 300)
            };

            int i = 0;

            foreach (var t in ht.TimingData())
            {
                if (i < shallTime.Length)
                {
                    Assert.AreEqual(shallTime[i], t.Time);
                }

                TestContext.WriteLine(t.Time.ToString());

                i++;
            }

            System.Threading.Thread.Sleep(200);

            TestContext.WriteLine(string.Format("progressCounter {0}", progressCounter));
            // Flaky test at Github
            //Assert.IsTrue(progressCounter > 2);
            //Assert.IsTrue(lastProgress.Finished);
        }