Skip to content

Created Calculator class and calculate method in SimpleCalculator interface#290

Open
dandalb wants to merge 6 commits into
mate-academy:masterfrom
dandalb:hw_jv-lambda-calc
Open

Created Calculator class and calculate method in SimpleCalculator interface#290
dandalb wants to merge 6 commits into
mate-academy:masterfrom
dandalb:hw_jv-lambda-calc

Conversation

@dandalb
Copy link
Copy Markdown

@dandalb dandalb commented Sep 13, 2021

No description provided.

Comment on lines +22 to +25
@BeforeEach
void setUp() {
calculator = new Calculator();
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

краще використати @BeforeAll , так як нам цей обєкт достатньо 1 раз оголосити

import org.junit.jupiter.api.Test;

class CalculatorTest {
private static final double A_POSITIVE = 1.23;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private static final double A_POSITIVE = 1.23;
private static final double FIRST_POSITIVE_OPERAND = 1.23;

@Test
void calculate_additionPositiveOperands_Ok() {
double actual = calculator.calculate(A_POSITIVE, B_POSITIVE, ADDITION);
double expected = A_POSITIVE + B_POSITIVE;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expected should not be calculated in runtime

}

@Test
void calculate_exponentiationZero_Ok() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about zeroToNegativePower?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants