diff --git a/test/growth/calc/centile_test.exs b/test/growth/calc/centile_test.exs new file mode 100644 index 0000000..d43c73c --- /dev/null +++ b/test/growth/calc/centile_test.exs @@ -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 + @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