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); }
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, }); }