public void AsteroidsDAL_CSV_ReadCSV() { // 1. Stufe: Einlesen der Asteroiden aus der CSV- Datei // und erfassen im Sammler AsteroidsBL.IAsteroidsCollector collector = new AsteroidsCollector(); try { var reader = new AsteroidsCSVReader("Asteroids.csv", 2); while (!reader.EOF) { var asteroid = reader.Read(); collector.Add(asteroid); } Assert.IsTrue(collector.Count > 0); var repo = collector.CreateRepository(); var view = new Impl.ViewMockUp(); var presenter = new Impl.PresenterV1(view, repo); presenter.BtnNewClick(); Assert.IsFalse(view.EnableNewBtn); Assert.IsTrue(view.EnableDiameterMaxInKm); Assert.IsTrue(view.EnableDiameterMinInKm); Assert.IsTrue(view.EnableOrbitSunRadiusMaxInAU); Assert.IsTrue(view.EnableOrbitSunRadiusMinInAU); Assert.IsFalse(view.EnableFilterBtn); view.DiameterMinInKm = 100.0; //view.OrbitSunRadiusMinInAU = 3.0; presenter.BtnDefSortClick(); Assert.IsFalse(view.EnableSortBtn); Assert.IsFalse(view.EnableDiameterMaxInKm); Assert.IsFalse(view.EnableDiameterMinInKm); Assert.IsFalse(view.EnableOrbitSunRadiusMaxInAU); Assert.IsFalse(view.EnableOrbitSunRadiusMinInAU); Assert.IsTrue(view.EnableFilterBtn); Assert.IsTrue(view.EnableSortByDiameterAsc); Assert.IsTrue(view.EnableSortByOrbitSunRadiusAsc); view.SortByDiameterAsc = false; presenter.BtnFilterClick(); Assert.IsTrue(view.AsteroidSelection.Any()); var res = view.AsteroidSelection.Get(); } catch (Exception ex) { Assert.Fail(); } }
private void btnDefSort_Click(object sender, EventArgs e) { presenter.BtnDefSortClick(); }