浏览代码

Fix test case

Sam Jaffe 4 年之前
父节点
当前提交
60a7f33fe4
共有 2 个文件被更改,包括 5 次插入3 次删除
  1. 1 0
      README.md
  2. 4 3
      src/test/java/org/leumasjaffe/recipe/controller/ReplaceChildrenControllerTest.java

+ 1 - 0
README.md

@@ -12,6 +12,7 @@ A java program for the purpose of storing and categorizing various recipes.
 - [x] Allow specifying instructions on every step
 - [x] Allow user to lock a recipe, to view it as complete instead of in-edit
 - [x] Change number of servings from default
+- [ ] Investigate blank screen on load
 - [ ] Ensure that instructions are not cut off in lock-view
 - [ ] Support images
 - [ ] Ingredient/Tag searching for recipes

+ 4 - 3
src/test/java/org/leumasjaffe/recipe/controller/ReplaceChildrenControllerTest.java

@@ -31,13 +31,14 @@ class ReplaceChildrenControllerTest {
 	}
 
 	@Test
-	void testDoesNotReplaceComponentsWhenNoSizeChange() {
+	void testDoesNotReplaceComponentsWhenNoChange() {
 		doReturn(new Component[] { mock(Component.class), mock(Component.class) }).when(parent).getComponents();
 		
+		controller.accept(parent, null);
 		controller.accept(parent, null);
 		
-		verify(parent, never()).removeAll();
-		verify(parent, never()).add((Component) any());
+		verify(parent, times(1)).removeAll();
+		verify(parent, times(2)).add((Component) any());
 	}
 
 	@Test