Sha256: 93a7f4825c0b3f9f4f8ab585937d702a4a6121565786276448373b10ce415775
Contents?: true
Size: 1.89 KB
Versions: 1
Compression:
Stored size: 1.89 KB
Contents
#! /usr/bin/env ruby # coding: utf-8 require "helper" class TC_Deadline < Test::Unit::TestCase def setup date = Date.new(2012, 10, 15) @d00 = Sculd::Plan::Deadline.new(date, false, 10, 'deadlineA') date = DateTime.new(2012, 10, 15, 23, 45, 00) @d01 = Sculd::Plan::Deadline.new(date, false, 10, 'deadlineA') date = Date.new(2012, 10, 15) @d02 = Sculd::Plan::Deadline.new(date, false, nil, 'deadlineA') end #context 'Date[2012-10-15], 10, [2012-10-15]!10 deadlineA' do def test_priority today = Date.new(2012, 10, 15) assert_equal(20000, @d00.priority(today)) today = Date.new(2012, 10, 20) assert_equal(20000, @d00.priority(today)) today = Date.new(2012, 10, 10) assert_equal(15000, @d00.priority(today)) today = Date.new(2012, 10, 1) assert_equal(0, @d00.priority(today)) today = Date.new(2012, 10, 1) assert_equal( 0, @d02.priority(today)) today = Date.new(2012, 10, 8) assert_equal(10000, @d02.priority(today)) today = Date.new(2012, 10, 10) assert_equal(12857, @d02.priority(today)) today = Date.new(2012, 10, 15) assert_equal(20000, @d02.priority(today)) today = Date.new(2012, 10, 20) assert_equal(20000, @d02.priority(today)) end def test_event_dates results = @d00.event_dates assert_equal(2 , results.size) assert_equal(Date.new(2012, 10, 5), results[0] ) assert_equal(Date.new(2012, 10, 15), results[1] ) assert_equal(Date , results[0].class ) assert_equal(Date , results[1].class ) results = @d01.event_dates assert_equal(2 , results.size) assert_equal(Date.new(2012, 10, 5), results[0] ) assert_equal(Date.new(2012, 10, 15), results[1] ) assert_equal(Date , results[0].class ) assert_equal(Date , results[1].class ) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sculd-0.1.1 | test/test_deadline.rb |