Skip to content

create P21_StringIntoIntegers_Test#75

Open
DeedeeDL wants to merge 4 commits intomainfrom
P21_StringIntoInteger_Test
Open

create P21_StringIntoIntegers_Test#75
DeedeeDL wants to merge 4 commits intomainfrom
P21_StringIntoInteger_Test

Conversation

@DeedeeDL
Copy link
Owner

@DeedeeDL DeedeeDL commented Apr 4, 2024

This will test the program where we convert a string into an integer

package org.example;
public class C01_10_MultiplicationOfIntegers {
public static int multiply(int num1, int num2) {
public static int multiplication(int num1, int num2) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Methods usualy represent actions so multiply is correct, multiplication is not.

@andreiursudev
Copy link
Collaborator

This PR has conflicts. Click the Resolve conflicts button and solve the conflicts.

@DeedeeDL DeedeeDL requested a review from andreiursudev April 8, 2024 18:57
void getNumber() {
String text= "1234";
int number = P21_StringIntoInteger.stringToInteger(text);
assertEquals("1234", text);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Assert number variable not text.

Copy link
Owner Author

Choose a reason for hiding this comment

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

done

int number = P21_StringIntoInteger.stringToInteger(text);
assertEquals("1234", text);
String number = "1234";
int text = P21_StringIntoInteger.stringToInteger(number);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Naming text an integer number is not good naming. Give variables proper names.

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.

2 participants