Initial commit.
This commit is contained in:
31
test/net/woodyfolsom/cs6601/p2/RecipeBookReaderTest.java
Normal file
31
test/net/woodyfolsom/cs6601/p2/RecipeBookReaderTest.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package net.woodyfolsom.cs6601.p2;
|
||||
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import net.woodyfolsom.cs6601.p2.Recipe;
|
||||
import net.woodyfolsom.cs6601.p2.RecipeBook;
|
||||
import net.woodyfolsom.cs6601.p2.RecipeBookReader;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class RecipeBookReaderTest {
|
||||
|
||||
@Test
|
||||
public void testReadRecipeBook() {
|
||||
RecipeBook recipeBook = RecipeBookReader.readRecipeBook(new File("data/PastelVasco.xml"));
|
||||
assertNotNull(recipeBook);
|
||||
assertThat(recipeBook.getSize(), is(equalTo(1)));
|
||||
|
||||
Recipe recipe = recipeBook.getRecipe(0);
|
||||
assertThat(recipe.getHead().getTitle(), is(equalTo("Gateau Basque / Pastel Vasco")));
|
||||
assertTrue(recipe.getHead().isCategoryMatch("Desserts"));
|
||||
assertTrue(recipe.getHead().isCategoryMatch("Sweets"));
|
||||
assertFalse(recipe.getHead().isCategoryMatch("Meat"));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user