require_relative "../classes.rb"

class TestDefenseBehavior < BaseBehaviorTestCase

  def setup
    super
    @subject1 = Traveller.new
    @subject2 = Traveller.new
    test_init_gauges
  end

  def test_release_defender_choice_event_on_hit_attempt
    #t = AR::Game::AttackBehavior::Punch.new
    a = AR::Game::AttackAction.new @subject1
    a.parameter("target").argument = @subject2
    e = AR::Events::ActionBeganEvent.new performer: @subject1, action: a
    results = e.resolve!
    e = results.select{|r| r.class == AR::Events::DefenseChoice}.last
    assert_equal @subject2, e.defender 
    assert_equal @subject1, e.attacker

    e.resolve!
  end


end

