def setUp(self):
        self.decision = Decision()
        self.member = Member()
        self.bill = Bill()
        self.strategy = NormativeDecisionStrategy(self.decision, self.member, self.bill)

        self.stance = Stance()
        self.stance.issue = "Some Issue"
        self.stance.side = outcomes.FOR

        self.stance1 = Stance()
        self.stance1.issue = "Some Other Issue"
        self.stance1.side = outcomes.AGN
class NormativeDecisionStrategyTest(unittest.TestCase):
    """ Test suite for normative_decision_strategy.py."""

    def setUp(self):
        self.decision = Decision()
        self.member = Member()
        self.bill = Bill()
        self.strategy = NormativeDecisionStrategy(self.decision, self.member, self.bill)

        self.stance = Stance()
        self.stance.issue = "Some Issue"
        self.stance.side = outcomes.FOR

        self.stance1 = Stance()
        self.stance1.issue = "Some Other Issue"
        self.stance1.side = outcomes.AGN


    def test_init(self):
        """Tests whether a strategy can be constructed properly"""
        result = NormativeDecisionStrategy(self.decision, self.member, self.bill)

        self.assertEqual(result._name, "Normative Decision")
        self.assertEqual(result._decision, self.decision)
        self.assertEqual(result._member, self.member)
        self.assertEqual(result._bill, self.bill)
        self.assertEqual(result._success, False)

    def test_run_fail_no_norm_stances(self):
        """ Verifies the function fails if there are no normative stances."""
        self.decision.for_bill_norms = []
        self.decision.agn_bill_norms = []
        result = self.strategy.run()

        self.assertFalse(result)
        self.assertFalse(self.strategy._success)
        self.assertEquals(self.decision.result, None)
        self.assertEquals(self.decision.reason, None)


    def test_run_fail_norms_on_both_sides(self):
        """ Verifies the function fails if there are normative stances on both sides."""
        self.decision.for_bill_norms = [self.stance]
        self.decision.agn_bill_norms = [self.stance1]
        result = self.strategy.run()

        self.assertFalse(result)
        self.assertFalse(self.strategy._success)
        self.assertEquals(self.decision.result, None)
        self.assertEquals(self.decision.reason, None)

    def test_run_success_FOR(self):
        """ Verifies that run() successfully makes a decision FOR"""
        self.decision.for_bill_norms = [self.stance, self.stance]
        self.decision.agn_bill_norms = []
        result = self.strategy.run()

        self.assertTrue(result)
        self.assertTrue(self.strategy._success)
        self.assertEquals(self.decision.result, outcomes.FOR)
        self.assertEquals(self.decision.reason, self.decision.for_bill_norms)
        self.assertEquals(self.decision.downside, self.decision.agn_bill_norms)

    def test_run_success_AGN(self):
        """ Verifies that run() successfully makes a decision AGN"""
        self.decision.for_bill_norms = []
        self.decision.agn_bill_norms = [self.stance1, self.stance1]
        result = self.strategy.run()

        self.assertTrue(result)
        self.assertTrue(self.strategy._success)
        self.assertEquals(self.decision.result, outcomes.AGN)
        self.assertEquals(self.decision.reason, self.decision.agn_bill_norms)
        self.assertEquals(self.decision.downside, self.decision.for_bill_norms)

    def test_explain(self):
        """ Verifies explain runs if there is a success [aka _explain is implemented]."""
        self.decision.for_bill_norms = [self.stance, self.stance]
        self.decision.agn_bill_norms = []
        result = self.strategy.run()

        self.assertTrue(result)
        self.strategy.explain()