Browse Source

Added Menu with test

feature-menu
Nick Stolbov 3 years ago
parent
commit
4fbe2b0830
  1. 1
      .gitignore
  2. 18
      src/main/java/Application/Menu.java
  3. 24
      src/test/java/Application/MenuTest.java

1
.gitignore

@ -1 +1,2 @@
.idea/
target/ target/

18
src/main/java/Application/Menu.java

@ -0,0 +1,18 @@
package Application;
public class Menu {
private String name;
public Menu(String name){
setName(name);
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}

24
src/test/java/Application/MenuTest.java

@ -0,0 +1,24 @@
package Application;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class MenuTest {
@BeforeEach
void setUp() {
}
@AfterEach
void tearDown() {
}
@Test
void testCorrectName(){
Menu menu = new Menu("Item 1");
assertTrue(menu.getName().equals("Item 1"));
}
}
Loading…
Cancel
Save