/**
  * Test method for {@link DivisionExpression#toString()}. Asserts that the method was overridden.
  */
 @Test
 public void toStringT() {
   assertThat(
       new DivisionExpression(
           EVALUABLE_EXPRESSION_FACTORY.getOne(), EVALUABLE_EXPRESSION_FACTORY.getOne()),
       hasOverriddenToString());
 }
 /**
  * Test method for {@link DivisionExpression#getDividend()}. Asserts that in returns the dividend.
  */
 @Test
 public void getDividend() {
   final EvaluableExpression dividend = EVALUABLE_EXPRESSION_FACTORY.getOne();
   assertThat(
       "should return the instance passed in the constructor!",
       new DivisionExpression(dividend, EVALUABLE_EXPRESSION_FACTORY.getOne()).getDividend(),
       is(theInstance(dividend)));
 }
  /**
   * Test method for {@link DivisionExpression#receive(dEvaluableExpressionVisitor)}. Asserts that
   * {@link EvaluableExpressionVisitor#visit(DivisionExpression)} is called.
   */
  @Test
  public void receive() {
    final EvaluableExpressionVisitor mockVisitor = mock(EvaluableExpressionVisitor.class);
    final DivisionExpression testedExpression =
        new DivisionExpression(
            EVALUABLE_EXPRESSION_FACTORY.getOne(), EVALUABLE_EXPRESSION_FACTORY.getOne());

    assertThat(() -> testedExpression.receive(null), throwsException(NullPointerException.class));
    testedExpression.receive(mockVisitor);

    then(mockVisitor).should().visit(same(testedExpression));
  }
  /**
   * Test method for {@link DivisionExpression#DivisionExpression(EvaluableExpression,
   * EvaluableExpression)} . Asserts that {@code null} cannot be passed and creation is possible.
   */
  @Test
  public void constructor() {
    new DivisionExpression(
        EVALUABLE_EXPRESSION_FACTORY.getOne(), EVALUABLE_EXPRESSION_FACTORY.getOne());

    assertThat(
        () -> new DivisionExpression(EVALUABLE_EXPRESSION_FACTORY.getOne(), null),
        throwsException(NullPointerException.class));
    assertThat(
        () -> new DivisionExpression(null, EVALUABLE_EXPRESSION_FACTORY.getOne()),
        throwsException(NullPointerException.class));
  }
  /**
   * Test method for {@link DivisionExpression#equals(java.lang.Object)} and {@link
   * DivisionExpression#hashCode()}. Asserts that:
   *
   * <ul>
   *   <li>All and only expressions with equal divisor and dividend are equal
   *   <li>{@code hashCode} is implemented accordingly
   * </ul>
   */
  @Test
  public void equalsAndHashCode() {
    final DivisionExpression equalOne =
        new DivisionExpression(
            EVALUABLE_EXPRESSION_FACTORY.getAll()[0], EVALUABLE_EXPRESSION_FACTORY.getAll()[1]);
    final DivisionExpression equalTwo =
        new DivisionExpression(
            EVALUABLE_EXPRESSION_FACTORY.getAll()[0], EVALUABLE_EXPRESSION_FACTORY.getAll()[1]);
    final DivisionExpression differentDivident =
        new DivisionExpression(
            EVALUABLE_EXPRESSION_FACTORY.getAll()[2], EVALUABLE_EXPRESSION_FACTORY.getAll()[1]);
    final DivisionExpression differentDivisor =
        new DivisionExpression(
            EVALUABLE_EXPRESSION_FACTORY.getAll()[0], EVALUABLE_EXPRESSION_FACTORY.getAll()[2]);
    final DivisionExpression swapped =
        new DivisionExpression(
            EVALUABLE_EXPRESSION_FACTORY.getAll()[1], EVALUABLE_EXPRESSION_FACTORY.getAll()[0]);

    assertThat(equalOne, hasDefaultEqualsProperties());
    assertThat(
        "expressions with equal divisor and divident should be equal",
        equalOne,
        is(equalTo(equalTwo)));
    assertThat(equalOne.hashCode(), is(equalTwo.hashCode()));
    assertThat(
        "expressions with different dividents must not be equal",
        equalOne,
        is(not(equalTo(differentDivident))));
    assertThat(
        "expressions with different divisors must not be equal",
        equalOne,
        is(not(equalTo(differentDivisor))));
    assertThat(
        "expressions with different dividends and divisiors must not be equal",
        equalOne,
        is(not(equalTo(swapped))));
  }