name-badge

This commit is contained in:
2023-12-18 15:02:33 -05:00
parent b69dc97356
commit 7332230435
11 changed files with 331 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
defmodule NameBadgeTest do
use ExUnit.Case
doctest NameBadge
describe "print/3" do
@tag task_id: 1
test "prints the employee badge with full data" do
assert NameBadge.print(455, "Mary M. Brown", "MARKETING") ==
"[455] - Mary M. Brown - MARKETING"
end
@tag task_id: 1
test "uppercases the department" do
assert NameBadge.print(89, "Jack McGregor", "Procurement") ==
"[89] - Jack McGregor - PROCUREMENT"
end
@tag task_id: 2
test "prints the employee badge without id" do
assert NameBadge.print(nil, "Barbara White", "Security") == "Barbara White - SECURITY"
end
@tag task_id: 3
test "prints the owner badge" do
assert NameBadge.print(1, "Anna Johnson", nil) == "[1] - Anna Johnson - OWNER"
end
@tag task_id: 3
test "prints the owner badge without id" do
assert NameBadge.print(nil, "Stephen Dann", nil) == "Stephen Dann - OWNER"
end
end
end

View File

@@ -0,0 +1,2 @@
ExUnit.start()
ExUnit.configure(exclude: :pending, trace: true, seed: 0)