示例#1
0
        private ClientAPIPercentageFailure GetClientApiFailureData(
            IEnumerable <ResultOfTest> apiDetails)
        {
            int count = 0;
            ClientAPIPercentageFailure clientApiPercentageFailure =
                new ClientAPIPercentageFailure();

            foreach (ResultOfTest apiDetail in apiDetails)
            {
                count++;
                clientApiPercentageFailure.ApiName = apiDetail.ApiName;
                if (apiDetail.State.Contains("Failed"))
                {
                    clientApiPercentageFailure.TotalFailedCalls++;
                }
            }

            clientApiPercentageFailure.TotalCalls        = count;
            clientApiPercentageFailure.PercentageFailure =
                Math.Round((Convert.ToDouble(clientApiPercentageFailure.TotalFailedCalls) /
                            Convert.ToDouble(clientApiPercentageFailure.TotalCalls)) * 100, 2);

            return(clientApiPercentageFailure);
        }
示例#2
0
        private ClientAPIPercentageFailure GetClientApiFailureData(
            IEnumerable<ResultOfTest> apiDetails)
        {
            int count = 0;
            ClientAPIPercentageFailure clientApiPercentageFailure =
                new ClientAPIPercentageFailure();

            foreach (ResultOfTest apiDetail in apiDetails)
            {
                count++;
                clientApiPercentageFailure.ApiName = apiDetail.ApiName;
                if (apiDetail.State.Contains("Failed"))
                {
                    clientApiPercentageFailure.TotalFailedCalls++;
                }
            }

            clientApiPercentageFailure.TotalCalls = count;
            clientApiPercentageFailure.PercentageFailure =
                Math.Round((Convert.ToDouble(clientApiPercentageFailure.TotalFailedCalls) /
                            Convert.ToDouble(clientApiPercentageFailure.TotalCalls)) * 100, 2);

            return clientApiPercentageFailure;
        }