Exemple #1
0
        public void CalculateRepUtiliziationTestPerformCalculation()
        {
            //initialize a product type.
            string[] productTypes = new string[] { ProductData.CAR_STEREO_PRODUCT };

            //initialize a service desk.
            ServiceDesk sd = new ServiceDesk(productTypes[0], 1, 0, null);

            //initialze the service desk representative work time (30 minutes in seconds)
            sd.AddEntity(null, 1800);

            //initialize  a statistic handler.
            StatisticsHandler_Accessor target = new StatisticsHandler_Accessor(0, productTypes);

            //initialize the total work time (in minutes)
            target.ObserveTime = 60;

            //intialize the expected result (the service rep should have worked
            //for 50% of the available time).
            double expected = 0.5;

            //perform action
            target.CalculateRepUtiliziation(sd);
            double result = target.RepUtilization[productTypes[0]];

            //check results
            Assert.AreEqual(expected, result);
        }
Exemple #2
0
        public void CalculateAverageNumberWaitingTestDivisionByZero()
        {
            //initialize a product type.
            string[] productTypes = new string[] { ProductData.CAR_STEREO_PRODUCT };

            //initialize  a statistic handler.
            StatisticsHandler_Accessor target = new StatisticsHandler_Accessor(0, productTypes);

            //intialize the expected result.
            double expected = double.NaN;

            //perform action.
            target.CalculateAverageNumberWaiting(productTypes[0]);
            double result = target.AverageNumberWaiting[productTypes[0]];

            //check results.
            Assert.AreEqual(expected, result);
        }
Exemple #3
0
        public void CalculateRepUtiliziationTestDivisionByZero()
        {
            //initialize a product type.
            string[] productTypes = new string[] { ProductData.CAR_STEREO_PRODUCT };

            //initialize a service desk.
            ServiceDesk sd = new ServiceDesk(productTypes[0], 1, 0, null);

            //initialize  a statistic handler.
            StatisticsHandler_Accessor target = new StatisticsHandler_Accessor(0, productTypes);

            //intialize the expected result.
            double expected = double.NaN;

            //perform atcion
            target.CalculateRepUtiliziation(sd);
            double result = target.RepUtilization[productTypes[0]];

            //check results
            Assert.AreEqual(expected, result);
        }
Exemple #4
0
        public void CalculateAverageSystemTimeTestPerformCalculation()
        {
            //initialize a product type.
            string[] productTypes = new string[] { ProductData.CAR_STEREO_PRODUCT };
            //initialize  a statistic handler.
            StatisticsHandler_Accessor target = new StatisticsHandler_Accessor(0, productTypes);
            //intialize the expected result.
            double expected = 9;

            //add system time samples
            target.TakeSystemTimeSample(3);
            target.TakeSystemTimeSample(6);
            target.TakeSystemTimeSample(9);
            target.TakeSystemTimeSample(12);
            target.TakeSystemTimeSample(15);

            //perform action.
            target.CalculateAverageSystemTime();
            double result = target.AverageSystemTime;

            //check results.
            Assert.AreEqual(expected, result);
        }
Exemple #5
0
        public void CalculateAverageNumberWaitingTestPerformCalculation()
        {
            //initialize a product type.
            string[] productTypes = new string[] { ProductData.CAR_STEREO_PRODUCT };
            //initialize  a statistic handler.
            StatisticsHandler_Accessor target = new StatisticsHandler_Accessor(0, productTypes);
            //intialize the expected result.
            double expected = 6;

            //add number waiting samples
            target.TakeNumberWaitingSample(productTypes[0], 2);
            target.TakeNumberWaitingSample(productTypes[0], 4);
            target.TakeNumberWaitingSample(productTypes[0], 6);
            target.TakeNumberWaitingSample(productTypes[0], 8);
            target.TakeNumberWaitingSample(productTypes[0], 10);

            //perform action.
            target.CalculateAverageNumberWaiting(productTypes[0]);
            double result = target.AverageNumberWaiting[productTypes[0]];

            //check results.
            Assert.AreEqual(expected, result);
        }