Skip to content

Commit

Permalink
Revert "Update Feature18Tests.java"
Browse files Browse the repository at this point in the history
This reverts commit ed59d68.
  • Loading branch information
hashreds committed Dec 6, 2023
1 parent b8172aa commit 45bad6d
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions app/src/test/java/cse/gradle/Feature18Tests.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,16 @@

import static org.junit.jupiter.api.Assertions.*;
import java.util.ArrayList;
import java.util.List;


class Feature18Tests {
// unit
@Test
void checkShare() {
MockModel model = new MockModel();
MockView view = new MockView(new ArrayList<Recipe>());
MockController controller = new MockController();
Recipe recipe = new Recipe("eggs, bacon", "cook for 10 minutes", "breakfast", "American breakfast");

assertEquals("html", controller.shareRecipe(recipe));
}
// BDD
@Test
void checkShareWithUser() {
Recipe r1 = new Recipe("eggs, bacon", "cook for 10 minutes", "breakfast", "American breakfast");
Recipe r2 = new Recipe("salmon, salad", "cook for 20 minutes", "breakfast", "Healthy Lunch");
Recipe r3 = new Recipe("potatoes", "boil the potatoes", "dinner", "boiled potatoes");
Recipe r4 = new Recipe("salmon", "boil the salmon", "dinner", "boiled salmon");
List<Recipe> rList = new ArrayList<>();
rList.add(r1);
rList.add(r2);
rList.add(r3);
rList.add(r4);
MockModel model = new MockModel();
User Joe = new User("abc", "123");
Joe.setRecipeList(rList);
MockView view = new MockView(new ArrayList<Recipe>());
MockController controller = new MockController();
Recipe recipe = new Recipe("eggs, bacon", "cook for 10 minutes", "breakfast", "American breakfast");

assertEquals("html", controller.shareRecipe(recipe));
}
}

0 comments on commit 45bad6d

Please sign in to comment.