[WIP] Implement growth assessment using WHO indicators #80

Draft
joao.dubas wants to merge 76 commits from jpd-feat-add-bmi-module-with-live-view into main
Showing only changes of commit 8c89b55487 - Show all commits

View File

@ -0,0 +1,24 @@
defmodule Growth.Calc.CentileTest do
@moduledoc false
use ExUnit.Case, async: true
import Growth.Data, only: [sample: 0]
doctest Growth.Calc.Centile
alias Growth.Calc.Centile
describe "compute/4" do
for %{key: key} = params <- sample() do
Review
The table-driven test is based on: https://blog.jpalardy.com/posts/a-table-driven-test-template-for-elixir/
@tag params: params
test "returns the measure given a z-score and box-cox fitted values #{key}", %{
params: params
} do
%{zscore: zscore, measure: measure, l: l, m: m, s: s} = params
assert_in_delta Centile.compute(zscore, l, m, s), measure, 0.05
end
end
end
end