public void InterventionStatisticMapperChildrenWATestCount()
        {
            Statistic.setOperationID("operation4");
            InterventionStatisticMapper ism = new InterventionStatisticMapper();
            List <String> complaints        = new List <String>();

            complaints = ism.getListComplaint();
            String firstComplaint = complaints[0];

            ism.getInterventionChildrenWithoutAmublanceCount(firstComplaint);
            List <int> interventionChildList = new List <int>();

            interventionChildList = ism.getInterventionChildrenWithoutAmublanceList();
            Assert.AreEqual(interventionChildList.Count, ism.getInterventionChildrenWithoutAmublanceList().Count);
            ism.clearInterventionChildrenWACountList();
            Assert.AreEqual(0, ism.getInterventionChildrenWithoutAmublanceList().Count);

            ism.getInterventionChildrenWithoutAmublanceCount("TESTING_NULL");
            interventionChildList = ism.getInterventionChildrenWithoutAmublanceList();
            Assert.AreEqual(0, interventionChildList[0]);
        }
Esempio n. 2
0
        private void GenerateInterventionWithoutAmbulance(int row, String complaint)
        {
            //generating table for Children without ambulance services
            ism.getInterventionChildrenWithoutAmublanceCount(complaint);

            foreach (int count in ism.getInterventionChildrenWithoutAmublanceList())
            {
                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();
                countWithoutAmbulance  += int.Parse(tb.Text.ToString());
                totalChildrenHoriCount += int.Parse(tb.Text.ToString());
                border.Child            = tb;
                ComplaintGrid.Children.Add(border);
                Grid.SetColumn(border, 1);
                Grid.SetRow(border, row);
            }
            ism.clearInterventionChildrenWACountList();

            //generating table for Adult without ambulance services
            ism.getInterventionAdultWithoutAmublanceCount(complaint);

            foreach (int count in ism.getInterventionAdultWithoutAmublanceList())
            {
                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();
                countWithoutAmbulance += int.Parse(tb.Text.ToString());
                totalAdultHoriCount   += int.Parse(tb.Text.ToString());
                border.Child           = tb;
                ComplaintGrid.Children.Add(border);
                Grid.SetColumn(border, 2);
                Grid.SetRow(border, row);
            }
            ism.clearInterventionAdultWACountList();


            //generating total table for without 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      = countWithoutAmbulance.ToString();
            totalBorder.Child = totalTb;
            ComplaintGrid.Children.Add(totalBorder);
            Grid.SetColumn(totalBorder, 3);
            Grid.SetRow(totalBorder, row);
        }