예제 #1
0
 public static bool AreEqual(TaskStatisticsModel model, TaskStatisticsDto dto, double tolerance)
 {
     return(Math.Abs(model.Max - dto.Max) < tolerance &&
            Math.Abs(model.Min - dto.Min) < tolerance &&
            Math.Abs(model.Mean - dto.Mean) < tolerance &&
            Math.Abs(model.Sd - dto.Sd) < tolerance &&
            Math.Abs(model.Tau - dto.Tau) < tolerance &&
            Math.Abs(model.SampleSize - dto.SampleSize) < tolerance &&
            Math.Abs(model.MarginOfError - dto.MarginOfError) < tolerance);
 }
예제 #2
0
        public static TaskStatisticsDto ToDto(this TaskStatisticsModel statisticsModel)
        {
            if (statisticsModel == null)
            {
                throw new ArgumentNullException(nameof(statisticsModel));
            }

            return(new TaskStatisticsDto
            {
                Max = statisticsModel.Max,
                Mean = statisticsModel.Mean,
                Min = statisticsModel.Min,
                Sd = statisticsModel.Sd,
                Tau = statisticsModel.Tau,
                SampleSize = statisticsModel.SampleSize,
                MarginOfError = statisticsModel.MarginOfError,
            });
        }