示例#1
0
 def test_subtract_numbers_with_real_and_imaginary_part(self):
     first_input = ComplexNumber(1, 2)
     second_input = ComplexNumber(3, 4)
     self.assertEqual(first_input.sub(second_input).real, -2)
     self.assertEqual(first_input.sub(second_input).imaginary, -2)
示例#2
0
 def test_subtract_purely_imaginary_numbers(self):
     first_input = ComplexNumber(0, 1)
     second_input = ComplexNumber(0, 2)
     self.assertEqual(first_input.sub(second_input).real, 0)
     self.assertEqual(first_input.sub(second_input).imaginary, -1)