1. Shuji Watanabe
  2. tddbc-sapporo

Commits

shuji.w6e  committed fae3323

add isDeleteTarget test

  • Participants
  • Parent commits 501b349
  • Branches default

Comments (0)

Files changed (2)

File src/main/java/tddbc/LRUCache.java

View file
 
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Stack;
 
 public class LRUCache {
 
     private final Map<String, String> container = new HashMap<String, String>();
-    private Stack<String> stack = new Stack<String>();
     private final int cacheSize;
 
     public LRUCache(int cacheSize) {
         return Math.min(container.size(), cacheSize);
     }
 
-    public int indexOf(String key) {
-        return container.containsKey(key) ? 0 : -1;
+    public boolean isDeleteTarget(String key) {
+        return false;
     }
 
 }

File src/test/java/tddbc/LRUCacheTest.java

View file
     }
     
     @Test
-    public void indexOf() throws Exception {
-        target.put("a", "dataA");
-        assertThat(target.indexOf("a"), is(0));
-    }
-
-    @Test
-    public void indexOf_notExistKey() throws Exception {
-        assertThat(target.indexOf("a"), is(-1));
+    public void isDeleteTarget() throws Exception {
+        assertThat(target.isDeleteTarget("a"), is(false));
     }
 }