Skip to content

Commit

Permalink
Added test for Timed.Reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
corka149 committed May 8, 2019
1 parent 046e543 commit 7b955b3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/reporter_test.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
defmodule Timed.ReporterTest do
use ExUnit.Case
doctest Timed.Reporter

test "calc_total_overtime with three timed elements" do
t1 = %Timed{start: ~N/2019-03-01 07:30:00/, end: ~N/2019-03-01 17:00:00/, break: 30} # 1hr
t2 = %Timed{start: ~N/2019-03-02 07:30:00/, end: ~N/2019-03-02 17:00:00/, break: 60} # 0.5hr
t3 = %Timed{start: ~N/2019-03-03 08:30:00/, end: ~N/2019-03-03 18:00:00/, break: 30} # 1 hr
timed_list = [t1, t2, t3]
overtime = Timed.Reporter.calc_total_overtime timed_list
assert 2.5 == overtime
end
end

0 comments on commit 7b955b3

Please sign in to comment.