public void GetBestDriverGetBestDoubleAdd() { string meest = "meest"; _competition.DriverPoints.AddItemToList(new DriverPoints() { Name = "minst", Points = 1 }); _competition.DriverPoints.AddItemToList(new DriverPoints() { Name = "meest", Points = 99 }); _competition.DriverPoints.AddItemToList(new DriverPoints() { Name = "minst", Points = 99 }); _competition.DriverPoints.AddItemToList(new DriverPoints() { Name = "meest", Points = 99 }); DriverPoints x = new DriverPoints() { Name = "meest", Points = 99 }; //string winner = x.GetBestDriver(_competition.DriverPoints.list); //Assert.AreEqual(meest, winner); }
public void Model_DriverPoints_Add_To_List_DriverPoints(int PointAmount, string Driver) { var points = new DriverPoints(Driver, PointAmount); List <DriverPoints> list = new List <DriverPoints>(); points.Add(list); Assert.AreEqual(Driver, points.GetBest(list)); }
public void OnNextRaceEvent(Object sender, RaceStartEventArgs e) { Data.CurrentRace.NextRace += OnNextRaceEvent; CompetitionName = Data.Competition.Name; DriverPoints = Data.Competition.DriverPoints; BestDriver = DriverPoints.GetHighest(); DriverPointsList = DriverPoints.GetList().ToList(); PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("")); }
public void GetBestDriverNoAdd() { string meest = null; DriverPoints x = new DriverPoints() { Name = "meest", Points = 99 }; string winner = x.GetBestDriverName(_competition.DriverPoints.list); Assert.AreEqual(meest, null); }
private void LoadData() { var awSectlist = DataProvider.GetSectorList().GetAwaiter(); awSectlist.OnCompleted(() => { var collection = awSectlist.GetResult(); foreach (var item in collection) { Sectors.Add(item); } }); var awPointlist = DataProvider.GetDriverList().GetAwaiter(); awPointlist.OnCompleted(() => { var collection = awPointlist.GetResult(); foreach (var item in collection) { DriverPoints.Add(item); } }); Orders = new ObservableCollection <Order>(); Orders.Add(new Order() { Client = "Jon", TrafficPoints = new TrafficPoint[2] { new TrafficPoint { Address = "Фучика, 14б" }, new TrafficPoint { Address = "Кирова, 59" } } }); Orders.Add(new Order() { Client = "Bill", TrafficPoints = new TrafficPoint[2] { new TrafficPoint { Address = "Коммунаровская, 26" }, new TrafficPoint { Address = "Глинки, 2" } } }); Orders.Add(new Order() { Client = "Henry", TrafficPoints = new TrafficPoint[2] { new TrafficPoint { Address = "Карла маркса, 1" }, new TrafficPoint { Address = "Глинки, 2" } } }); }
public void Model_DriverPoints_Create_DriverPoints(int PointAmount, string Driver) { var points = new DriverPoints(Driver, PointAmount); Assert.AreEqual(points.Name, Driver); }
public DriverPoints DriverPointSave(DriverPoints driverpoint) { return(driverpointservice.DriverPointSave(driverpoint)); }