test(growth): add bmi test

This commit is contained in:
João Paulo Dubas 2024-10-05 12:55:44 +00:00
parent 7670dce630
commit c9e3bf68ae
Signed by: joao.dubas
SSH Key Fingerprint: SHA256:V1mixgOGRc/YMhGx/DNkOSmJxgA2vHNrDZEk3wt/kOA

View File

@ -0,0 +1,23 @@
defmodule Growth.Calc.BMITest do
@moduledoc false
use ExUnit.Case, async: true
alias Growth.Calc.BMI
describe "calculate/3" do
test "in metric system" do
weight_kg = 78.5
height_cm = 168.2
assert 27.74710475751505 == BMI.calculate(:metric, weight_kg, height_cm)
end
test "in english system" do
weight_lb = 173.1
height_in = 66.2
assert 27.770202207557876 == BMI.calculate(:english, weight_lb, height_in)
end
end
end