public void InterventionStatisticMapperChildrenATestCount() { Statistic.setOperationID("operation4"); InterventionStatisticMapper ism = new InterventionStatisticMapper(); List <String> complaints = new List <String>(); complaints = ism.getListComplaint(); String firstComplaint = complaints[0]; ism.getInterventionChildrenWithAmublanceCount(firstComplaint); List <int> interventionChildList = new List <int>(); interventionChildList = ism.getInterventionChildrenWithAmublanceList(); Assert.AreEqual(interventionChildList.Count, ism.getInterventionChildrenWithAmublanceList().Count); ism.clearInterventionChildrenACountList(); Assert.AreEqual(0, ism.getInterventionChildrenWithAmublanceList().Count); ism.getInterventionChildrenWithAmublanceCount("TESTING_NULL"); interventionChildList = ism.getInterventionChildrenWithAmublanceList(); Assert.AreEqual(0, interventionChildList[0]); }
private void GenerateInterventionWithAmbulance(int row, String complaint) { //generating table for Children with ambulance services ism.getInterventionChildrenWithAmublanceCount(complaint); foreach (int count in ism.getInterventionChildrenWithAmublanceList()) { Border border = new Border(); border.BorderThickness = new Thickness(0, 0, 1, 1); border.BorderBrush = new SolidColorBrush(Colors.Black); TextBlock tb = new TextBlock(); tb.FontWeight = FontWeights.Black; tb.Height = 40; tb.FontSize = 12; tb.Margin = new Thickness(3, 0, 0, 0); tb.VerticalAlignment = VerticalAlignment.Center; tb.HorizontalAlignment = HorizontalAlignment.Center; tb.Text = count.ToString(); countWithAmbulance += int.Parse(tb.Text.ToString()); totalChildrenHoriCount += int.Parse(tb.Text.ToString()); border.Child = tb; ComplaintGrid.Children.Add(border); Grid.SetColumn(border, 4); Grid.SetRow(border, row); } ism.clearInterventionChildrenACountList(); //generating table for Adult with ambulance services ism.getInterventionAdultWithAmublanceCount(complaint); foreach (int count in ism.getInterventionAdultWithAmublanceList()) { Border border = new Border(); border.BorderThickness = new Thickness(0, 0, 1, 1); border.BorderBrush = new SolidColorBrush(Colors.Black); TextBlock tb = new TextBlock(); tb.FontWeight = FontWeights.Black; tb.Height = 40; tb.FontSize = 12; tb.Margin = new Thickness(3, 0, 0, 0); tb.VerticalAlignment = VerticalAlignment.Center; tb.HorizontalAlignment = HorizontalAlignment.Center; tb.Text = count.ToString(); countWithAmbulance += int.Parse(tb.Text.ToString()); totalAdultHoriCount += int.Parse(tb.Text.ToString()); border.Child = tb; ComplaintGrid.Children.Add(border); Grid.SetColumn(border, 5); Grid.SetRow(border, row); } ism.clearInterventionAdultACountList(); //generating total table for with amublance services Border totalBorder = new Border(); totalBorder.BorderThickness = new Thickness(0, 0, 1, 1); totalBorder.BorderBrush = new SolidColorBrush(Colors.Black); TextBlock totalTb = new TextBlock(); totalTb.FontWeight = FontWeights.Black; totalTb.Height = 40; totalTb.FontSize = 12; totalTb.Margin = new Thickness(3, 0, 0, 0); totalTb.VerticalAlignment = VerticalAlignment.Center; totalTb.HorizontalAlignment = HorizontalAlignment.Center; totalTb.Text = countWithAmbulance.ToString(); totalBorder.Child = totalTb; ComplaintGrid.Children.Add(totalBorder); Grid.SetColumn(totalBorder, 6); Grid.SetRow(totalBorder, row); }