Skip to content

Commit

Permalink
Add show menu feature
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermedias committed Jul 31, 2015
1 parent c638a5f commit ca2b34b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/com/twu/biblioteca/BibliotecaApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ public class BibliotecaApp {

public static void main(String[] args) {
Biblioteca biblioteca = new Biblioteca();
Menu menu = new Menu();

System.out.println(biblioteca.welcomeUser());

for(Book book : biblioteca.listBooks()) {
System.out.println(book.showDetails() + "\n");
}
System.out.println(menu.listOptions());
}
}
10 changes: 10 additions & 0 deletions src/com/twu/biblioteca/Menu.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.twu.biblioteca;

/**
* Created by gdias on 7/31/15.
*/
public class Menu {
public String listOptions() {
return "1 - List books";
}
}
15 changes: 15 additions & 0 deletions test/com/twu/biblioteca/MenuTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.twu.biblioteca;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

/**
* Created by gdias on 7/31/15.
*/
public class MenuTest {
@Test
public void listOptions_ShouldReturnTheMenuOptions() throws Exception {
assertEquals("1 - List books", new Menu().listOptions());
}
}

0 comments on commit ca2b34b

Please sign in to comment.