+ def test_next_year01
+ now = DateTime.new(2011, 12, 30, 21, 20, 15) # Fri
+ ntc = ShogiServer::League::Floodgate::NextTimeGeneratorConfig.new ["Sun 00:00"]
+ assert_equal Time.parse("01-01-2012 00:00"), ntc.call(now)
+ ntc = ShogiServer::League::Floodgate::NextTimeGeneratorConfig.new ["Sun 01:00"]
+ assert_equal Time.parse("01-01-2012 01:00"), ntc.call(now)
+ end
+
+ def test_next_year02
+ now = DateTime.new(2011, 12, 30, 21, 20, 15) # Fri
+ ntc = ShogiServer::League::Floodgate::NextTimeGeneratorConfig.new ["Mon 00:00"]
+ assert_equal Time.parse("02-01-2012 00:00"), ntc.call(now)
+ ntc = ShogiServer::League::Floodgate::NextTimeGeneratorConfig.new ["Mon 01:00"]
+ assert_equal Time.parse("02-01-2012 01:00"), ntc.call(now)
+ end
+
+ def test_new_year
+ now = DateTime.new(2012, 1, 1, 1) # Sun; cwyear=2011, cweek=52
+ ntc = ShogiServer::League::Floodgate::NextTimeGeneratorConfig.new ["Mon 00:00"]
+ assert_equal Time.parse("02-01-2012 00:00"), ntc.call(now)
+ ntc = ShogiServer::League::Floodgate::NextTimeGeneratorConfig.new ["Sat 00:00"]
+ assert_equal Time.parse("07-01-2012 00:00"), ntc.call(now)
+ end
+