X-Git-Url: http://git.sourceforge.jp/view?p=shogi-server%2Fshogi-server.git;a=blobdiff_plain;f=test%2FTC_floodgate_next_time_generator.rb;h=c91cdfef8bcaf81d5587efb062f03ae70eb66c08;hp=2388634705e201e4c5739cf9c574122aae3dc97d;hb=13a823aebe192a11f1feaad5bb0600d2b637c32a;hpb=42fea02e19112ca25966e705ee98cd45cfc70155 diff --git a/test/TC_floodgate_next_time_generator.rb b/test/TC_floodgate_next_time_generator.rb index 2388634..c91cdfe 100644 --- a/test/TC_floodgate_next_time_generator.rb +++ b/test/TC_floodgate_next_time_generator.rb @@ -202,4 +202,20 @@ class TestNextTimeGeneratorConfig < Test::Unit::TestCase ntc = ShogiServer::League::Floodgate::NextTimeGeneratorConfig.new ["Thu 22:00"] assert_equal Time.parse("17-06-2010 22:00"), ntc.call(now) end + + def test_default_pairing_factory + now = DateTime.new(2010, 6, 10, 21, 59, 59) # Thu + lines = %w(Thu\ 22:00) + ntc = ShogiServer::League::Floodgate::NextTimeGeneratorConfig.new lines + assert_equal Time.parse("10-06-2010 22:00"), ntc.call(now) + assert_equal("default_factory", ntc.pairing_factory) + end + + def test_read_pairing_factory + now = DateTime.new(2010, 6, 10, 21, 59, 59) # Thu + lines = %w(set\ pairing_factory\ least_diff_pairing Thu\ 22:00) + ntc = ShogiServer::League::Floodgate::NextTimeGeneratorConfig.new lines + assert_equal Time.parse("10-06-2010 22:00"), ntc.call(now) + assert_equal("least_diff_pairing", ntc.pairing_factory) + end end