require "test/unit"
require "mock_rover"
requrie "ControlSystem"

class TestControlSystem < Test::Unit::TestCase

  def setup()
    rover = MockRover.new()
    @cs = ControlSystem.new(rover.motors, rover.acm)
  end

  def test_forward()
    #using 90 degrees to accommadate the values in the mock compass
    assert_nothing_raised(Exception){ @cs.forward(90, 2000) }
  end

  def test_turn_to_heading_continuous()
    assert_nothing_raised(Exception){ @cs.turn_to_heading_continuous(180) }
    assert_nothing_raised(Exception){ @cs.turn_to_heading_continuous(270) }
    assert_nothing_raised(Exception){ @cs.turn_to_heading_continuous(355) }
    assert_nothing_raised(Exception){ @cs.turn_to_heading_continuous(5) }
    assert_nothing_raised(Exception){ @cs.turn_to_heading_continuous(95) }
  end

end