Example #1
0
 def test_validate_args_where_item_and_action_are_none(self):
     # initialize
     expected_result = "NO_ITEM"
     invoice = Invoice()
     invoice.args = ArgsMock()
     # test
     result = invoice.validate_args()
     # verify
     self.assertEqual(result, expected_result)
     return
Example #2
0
 def test_select_strategy_where_args_item_is_i(self):
     # initialize
     expected_result = ""
     invoice = Invoice()
     invoice.args = ArgsMock()
     invoice.args.item = "i"
     # test
     invoice.select_strategy()
     # verify
     self.assertTrue(isinstance(invoice.strategy, InvoiceStrategy))
     return
Example #3
0
 def test_validate_args_where_action_is_none(self):
     # initialize
     expected_result = "NO_ACTION"
     invoice = Invoice()
     invoice.args = ArgsMock()
     invoice.args.item = "company"
     # test
     result = invoice.validate_args()
     # verify
     self.assertEqual(result, expected_result)
     return
Example #4
0
 def test_validate_args_where_item_and_action_are_set_to_valid_values(self):
     # initialize
     expected_result = ""
     invoice = Invoice()
     invoice.args = ArgsMock()
     invoice.args.item = "company"
     invoice.args.action = "add"
     # test
     result = invoice.validate_args()
     # verify
     self.assertEqual(result, expected_result)
     return