From c9e3bf68ae4d47417885d59459142f77089d7a52 Mon Sep 17 00:00:00 2001 From: Joao P Dubas Date: Sat, 5 Oct 2024 12:55:44 +0000 Subject: [PATCH] test(growth): add bmi test --- test/growth/calc/bmi_test.exs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/growth/calc/bmi_test.exs diff --git a/test/growth/calc/bmi_test.exs b/test/growth/calc/bmi_test.exs new file mode 100644 index 0000000..7950e63 --- /dev/null +++ b/test/growth/calc/bmi_test.exs @@ -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