def test_when_red_pencil_passed_two_rows_return_1_red_pencil(self): self.assertEqual( rp.red_pencil(two_rows), ( [(dt(2, 1, 1), 8.00)], # red pencil start [dt(2, 1, 31)] # red pencil end ))
def test_when_is_red_pencil_passed_tuple_return_none(self): self.assertIsNone(rp.red_pencil(()))
def test_when_red_pencil_passed_one_row_return_empty_array(self): self.assertEqual(rp.red_pencil(one_row), ([], []))
def test_when_red_pencil_passed_three_rows_price_decrease_return_1(self): self.assertEqual(rp.red_pencil(three_rows_price_decrease), ( [(dt(1, 2, 2), 8.00)], [dt(1, 3, 4)], ))
def test_when_red_pencil_passed_three_rows_30_percent_return_1(self): self.assertEqual(rp.red_pencil(three_rows_30_percent), ( [(dt(1, 2, 2), 8.00)], [dt(1, 2, 4)], ))
def test_when_red_pencil_passed_two_rows_not_promo_range_return_none(self): self.assertEqual(rp.red_pencil(two_rows_not_promo_range), ([], []))
def test_when_red_pencil_passed_three_rows_end_early_return_1(self): self.assertEqual(rp.red_pencil(three_rows_end_early), ( [(dt(1, 2, 2), 8.00)], [dt(1, 2, 3)], ))
def test_when_red_pencil_passed_three_rows_return_none(self): self.assertEqual(rp.red_pencil(three_rows_return_none), ([], []))
def test_when_red_pencil_passed_three_rows_return_2_red_pencil(self): self.assertEqual( rp.red_pencil(three_rows_return_two), ([(dt(2, 1, 2), 8.00), (dt(2, 2, 28), 6.00)], [dt(2, 2, 1), dt(2, 3, 30)]))
def test_when_red_pencil_passed_three_rows_return_1_red_pencil(self): self.assertEqual(rp.red_pencil(three_rows), ([(dt(2, 1, 1), 8.00)], [dt(2, 1, 31)]))