public void QueueConverterModelToEntityTest() { QueueModel model = new QueueModel(23, Guid.NewGuid().ToString(), Guid.NewGuid().ToString()); IQueueConverter converter = new QueueConverter(LoggerFactory); QueueEntity actual = converter.Convert(model); Assert.AreEqual(model.Id, actual.Id); Assert.AreEqual(model.Name, actual.Name); Assert.AreEqual(model.Description, actual.Description); }
public void QueueConverterEntityToModelTest() { QueueEntity entity = new QueueEntity { Id = 23, Name = Guid.NewGuid().ToString(), Description = Guid.NewGuid().ToString() }; IQueueConverter converter = new QueueConverter(LoggerFactory); QueueModel actual = converter.Convert(entity); Assert.AreEqual(entity.Id, actual.Id); Assert.AreEqual(entity.Name, actual.Name); Assert.AreEqual(entity.Description, actual.Description); }
public MapSelectionPage() { InitializeComponent(); QueueButtonBox.Items.Clear(); QueueButtonBox2.Items.Clear(); var mapList = new List <int>(); var activeQueues = StaticVars.ActiveClient.RiotQueues.Where(x => x.QueueState == "ON"); foreach (var queues in activeQueues) { foreach (var mapId in queues.SupportedMapIds) { if (!mapList.Contains((int)mapId)) { mapList.Add((int)mapId); } } enabledQueues.Add((int)queues.Id); } foreach (var map in mapList) { var name = QueueConverter.MapToName((Map)map); if (name == "UnknownMap") { var mapView = new MapView { NameLabel = { Content = name }, MapImage = { Source = new BitmapImage(new Uri(System.IO.Path.Combine(StaticVars.IcyWindLocation, "IcyWindAssets", "Maps", $"map{map}.png"))) }, Tag = map }; mapView.MouseDown += MapView_MouseDown; MapListView.Items.Add(mapView); } else { var mapView = new MapView { NameLabel = { Content = name }, MapImage = { Source = new BitmapImage(new Uri(System.IO.Path.Combine(StaticVars.IcyWindLocation, "IcyWindAssets", "Maps", $"map{map}.png"))) }, Tag = map }; mapView.MouseDown += MapView_MouseDown; MapListView.Items.Add(mapView); } } }