input: Write a function to define a class in Python that represents a complex number. The class should have an initialization method to store the real and imaginary parts of the complex number. Additionally, it should have a method to return the complex number as a string in the form "(real + imaginary i)". Define the class and provide test cases to demonstrate the functionality.
  class ComplexNumber:
      def __init__(self, real, imaginary):
          self.real = real
          self.imaginary = imaginary
  
      def __str__(self):
          return "({0} + {1}i)".format(self.real, self.imaginary)
  
  assert str(ComplexNumber(1, 2))=="(1 + 2i)"
  assert str(ComplexNumber(-1, -2))=="(-1 + -2i)"
  assert str(ComplexNumber(0, 0))=="(0 + 0i)"
  assert str(ComplexNumber(3, -4))=="(3 + -4i)"
  assert str(ComplexNumber(-5, 0))=="(-5 + 0i)"
output: class ComplexNumber:
      def __init__(self, real, imaginary):
          self.real = real
          self.imaginary = imaginary
  
      def __str__(self):
          return "({0} + {1}i)".format(self.real, self.imaginary)