-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Done the task, cover all code by JUniy5 test. Try to do correct, now … #835
base: main
Are you sure you want to change the base?
Conversation
…have line coverage more than 90%
…have line coverage more than 90%. Fix problem with git, change some name of test
…have line coverage more than 90%. Fix problem with git, change some name of test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
almost good
FruitTransaction validTransaction = | ||
new FruitTransaction(DEFAULT_OPERATION, DEFAULT_NAME, DEFAULT_QUANTITY); | ||
assertEquals(DEFAULT_TRANSACTION, validTransaction); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FruitTransaction validTransaction = | |
new FruitTransaction(DEFAULT_OPERATION, DEFAULT_NAME, DEFAULT_QUANTITY); | |
assertEquals(DEFAULT_TRANSACTION, validTransaction); | |
} | |
FruitTransaction actualTransaction = | |
new FruitTransaction(DEFAULT_OPERATION, DEFAULT_NAME, DEFAULT_QUANTITY); | |
assertEquals(DEFAULT_TRANSACTION, actualTransaction); | |
} |
private static Map<FruitTransaction.Operation, OperationHandlers> operationHandlersMap = | ||
new HashMap<>() { | ||
{ | ||
put(FruitTransaction.Operation.BALANCE, new BalanceTypeHandler()); | ||
} | ||
}; | ||
|
||
private static final OperationStrategy OPERATION_STRATEGY | ||
= new OperationStrategyImpl(operationHandlersMap); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be done in setUp
method
private static Map<FruitTransaction.Operation, OperationHandlers> operationHandlersMap = | |
new HashMap<>() { | |
{ | |
put(FruitTransaction.Operation.BALANCE, new BalanceTypeHandler()); | |
} | |
}; | |
private static final OperationStrategy OPERATION_STRATEGY | |
= new OperationStrategyImpl(operationHandlersMap); | |
private static OperationStrategy strategy; | |
@BeforeAll | |
static void setUp() { | |
Map<FruitTransaction.Operation, OperationHandlers> operationHandlerMap = Map.of(FruitTransaction.Operation.BALANCE, new BalanceTypeHandler()); | |
strategy = new OperationStrategyImpl(operationHandlerMap); | |
} |
void balanceHandleTransaction_ValidData_Ok() { | ||
OPERATION_HANDLERS.handleTransaction(VALID_FRUIT_TRANSACTION); | ||
assertEquals(Map.of(VALID_NAME,VALID_QUANTITY).entrySet(),storage.entrySet()); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…have line coverage more than 90%