public void UpdatePoints2() { // Setup Data Model & Co string dbFilename = TestUtilities.CreateWorkingFileFrom(testContextInstance.TestDeploymentDir, @"1554MSBS.mdb"); Database db = new Database(); db.Connect(dbFilename); AppDataModel model = new AppDataModel(db); Race race = model.GetRace(0); // Import DSV Point List DSVImportReader dsvImportReader = new DSVImportReader(new DSVImportReaderZip(@"Punktelisten.zip", DSVImportReaderZipBase.EDSVListType.Pupils_U14U16)); // Check two prior Assert.AreEqual(148.86, race.GetParticipants().First(r => r.SvId == "24438").Points); Assert.AreEqual(129.12, race.GetParticipants().First(r => r.SvId == "25399").Points); var impRes = DSVUpdatePoints.UpdatePoints(model, dsvImportReader.Data, dsvImportReader.Mapping, dsvImportReader.UsedDSVList); Assert.AreEqual(1, impRes.Count); Assert.AreEqual(125, impRes[0].SuccessCount); Assert.AreEqual(2, impRes[0].ErrorCount); Assert.AreEqual(110.96, race.GetParticipants().First(r => r.SvId == "24438").Points); Assert.AreEqual(100.33, race.GetParticipants().First(r => r.SvId == "25399").Points); Assert.AreEqual("DSVSA20END", model.GetDB().GetKeyValue("DSV_UsedDSVList")); }
private void btnDSVUpdatePoints_Click(object sender, RoutedEventArgs e) { var impRes = DSVUpdatePoints.UpdatePoints(_dm, _dsvData.Data, _dsvData.Mapping, _dsvData.UsedDSVList); showUpdatePointsResult(impRes, _dsvData.UsedDSVList); }