Esempio n. 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);
 }
Esempio n. 2
0
        public static TaskStatisticsModel ToModel(this TaskStatisticsDto statisticsDto)
        {
            if (statisticsDto == null)
            {
                throw new ArgumentNullException(nameof(statisticsDto));
            }

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