2015-02-25 08:52:38 +01:00
|
|
|
require File.expand_path('../test_helper.rb', __FILE__)
|
|
|
|
|
|
|
|
class TaskTest < Minitest::Test
|
|
|
|
|
|
|
|
include WorkingClass
|
|
|
|
|
|
|
|
def test_initialize
|
2016-02-14 10:02:32 +01:00
|
|
|
task = Task.new(true, "Hello World")
|
2015-02-25 15:18:30 +01:00
|
|
|
|
2016-02-14 10:02:32 +01:00
|
|
|
assert(task.is_finished?)
|
|
|
|
assert_equal("Hello World", task.name)
|
|
|
|
assert(!task.has_reminder?)
|
|
|
|
assert_nil(task.reminder)
|
2015-02-25 15:18:30 +01:00
|
|
|
end
|
|
|
|
|
2016-02-14 10:02:32 +01:00
|
|
|
def test_initialize_with_reminder
|
|
|
|
task = Task.new(false, "Good Morning", Time.new(2016, 10, 5))
|
2015-02-25 15:18:30 +01:00
|
|
|
|
2016-02-14 10:02:32 +01:00
|
|
|
assert(!task.is_finished)
|
|
|
|
assert_equal("Good Morning", task.name)
|
|
|
|
assert(task.has_reminder)
|
|
|
|
assert_equal(Time.new(2016, 10, 5), task.reminder)
|
2015-02-25 08:52:38 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|