# Appointment reminders, tested with one double of each kind: a fake
# appointment book and clock, a stub, a spy, and a mock notifier. The
# retry wait is a function seam (std::function in the service, a
# template parameter in deliver_with_retry). The vendor SMS function is
# a link seam: the library leaves vendor::sms_send undefined, the demo
# links a console stand-in, and the adapter test links a fake.
add_library(tst_reminders STATIC reminders.cpp)
target_include_directories(tst_reminders PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

add_library(tst_reminders_sms STATIC sms_notifier.cpp)
target_link_libraries(tst_reminders_sms PUBLIC tst_reminders)

lld_add_example(tst_reminders_demo
  SOURCES main.cpp vendor_sms_console.cpp EXPECTED_OUTPUT expected_output.txt)
target_link_libraries(tst_reminders_demo PRIVATE tst_reminders_sms)

lld_add_test(tst_reminders_service_tests SOURCES tests/test_reminders.cpp LABELS unit)
target_link_libraries(tst_reminders_service_tests PRIVATE tst_reminders)

lld_add_test(tst_reminders_retry_tests SOURCES tests/test_retry.cpp LABELS unit)
target_link_libraries(tst_reminders_retry_tests PRIVATE tst_reminders)

lld_add_test(tst_reminders_sms_tests
  SOURCES tests/test_sms_notifier.cpp tests/fake_vendor_sms.cpp LABELS unit)
target_link_libraries(tst_reminders_sms_tests PRIVATE tst_reminders_sms)
