diff --git a/app/src/main/java/com/example/algorithmstudy/pattern/creation/prototype/MyComputer.kt b/app/src/main/java/com/example/algorithmstudy/pattern/creation/prototype/MyComputer.kt new file mode 100644 index 0000000..78b847a --- /dev/null +++ b/app/src/main/java/com/example/algorithmstudy/pattern/creation/prototype/MyComputer.kt @@ -0,0 +1,8 @@ +package com.example.algorithmstudy.pattern.creation.prototype + +data class MyComputer( + val motherBoard: String, + val graphicCard: String, + val cpu: String, + val ram: String +) \ No newline at end of file diff --git a/app/src/test/java/com/example/algorithmstudy/AlgorithmTest.kt b/app/src/test/java/com/example/algorithmstudy/algorithm/AlgorithmTest.kt similarity index 96% rename from app/src/test/java/com/example/algorithmstudy/AlgorithmTest.kt rename to app/src/test/java/com/example/algorithmstudy/algorithm/AlgorithmTest.kt index a8dd181..c1b7098 100644 --- a/app/src/test/java/com/example/algorithmstudy/AlgorithmTest.kt +++ b/app/src/test/java/com/example/algorithmstudy/algorithm/AlgorithmTest.kt @@ -1,7 +1,5 @@ -package com.example.algorithmstudy +package com.example.algorithmstudy.algorithm -import com.example.algorithmstudy.algorithm.BFS -import com.example.algorithmstudy.algorithm.DFS import com.example.algorithmstudy.datastructure.StackSolution import com.example.algorithmstudy.kotlin.CalculatorUtil import com.example.algorithmstudy.kotlin.StringUtil diff --git a/app/src/test/java/com/example/algorithmstudy/DPTest.kt b/app/src/test/java/com/example/algorithmstudy/algorithm/DPTest.kt similarity index 91% rename from app/src/test/java/com/example/algorithmstudy/DPTest.kt rename to app/src/test/java/com/example/algorithmstudy/algorithm/DPTest.kt index 75c80bc..e22285d 100644 --- a/app/src/test/java/com/example/algorithmstudy/DPTest.kt +++ b/app/src/test/java/com/example/algorithmstudy/algorithm/DPTest.kt @@ -1,4 +1,4 @@ -package com.example.algorithmstudy +package com.example.algorithmstudy.algorithm import com.example.algorithmstudy.java.DPJava import org.junit.Test diff --git a/app/src/test/java/com/example/algorithmstudy/DijstraTest.kt b/app/src/test/java/com/example/algorithmstudy/algorithm/DijstraTest.kt similarity index 88% rename from app/src/test/java/com/example/algorithmstudy/DijstraTest.kt rename to app/src/test/java/com/example/algorithmstudy/algorithm/DijstraTest.kt index 52aa890..99cbadc 100644 --- a/app/src/test/java/com/example/algorithmstudy/DijstraTest.kt +++ b/app/src/test/java/com/example/algorithmstudy/algorithm/DijstraTest.kt @@ -1,6 +1,5 @@ -package com.example.algorithmstudy +package com.example.algorithmstudy.algorithm -import com.example.algorithmstudy.algorithm.Dijkstra import org.junit.Test class DijstraTest { diff --git a/app/src/test/java/com/example/algorithmstudy/GreedyTest.kt b/app/src/test/java/com/example/algorithmstudy/algorithm/GreedyTest.kt similarity index 91% rename from app/src/test/java/com/example/algorithmstudy/GreedyTest.kt rename to app/src/test/java/com/example/algorithmstudy/algorithm/GreedyTest.kt index ed6abdc..1784d2e 100644 --- a/app/src/test/java/com/example/algorithmstudy/GreedyTest.kt +++ b/app/src/test/java/com/example/algorithmstudy/algorithm/GreedyTest.kt @@ -1,6 +1,5 @@ -package com.example.algorithmstudy +package com.example.algorithmstudy.algorithm -import com.example.algorithmstudy.algorithm.Greedy import com.example.algorithmstudy.java.GreedyJava import com.example.algorithmstudy.kotlin.GreedyUtil import org.junit.Test diff --git a/app/src/test/java/com/example/algorithmstudy/HashTest.kt b/app/src/test/java/com/example/algorithmstudy/algorithm/HashTest.kt similarity index 88% rename from app/src/test/java/com/example/algorithmstudy/HashTest.kt rename to app/src/test/java/com/example/algorithmstudy/algorithm/HashTest.kt index 7c1ee98..af7f748 100644 --- a/app/src/test/java/com/example/algorithmstudy/HashTest.kt +++ b/app/src/test/java/com/example/algorithmstudy/algorithm/HashTest.kt @@ -1,4 +1,4 @@ -package com.example.algorithmstudy +package com.example.algorithmstudy.algorithm import com.example.algorithmstudy.kotlin.HashUtil import org.junit.Test diff --git a/app/src/test/java/com/example/algorithmstudy/HeapTest.kt b/app/src/test/java/com/example/algorithmstudy/algorithm/HeapTest.kt similarity index 94% rename from app/src/test/java/com/example/algorithmstudy/HeapTest.kt rename to app/src/test/java/com/example/algorithmstudy/algorithm/HeapTest.kt index 8153924..2e0d3db 100644 --- a/app/src/test/java/com/example/algorithmstudy/HeapTest.kt +++ b/app/src/test/java/com/example/algorithmstudy/algorithm/HeapTest.kt @@ -1,4 +1,4 @@ -package com.example.algorithmstudy +package com.example.algorithmstudy.algorithm import com.example.algorithmstudy.java.PriorityQueueUtil import com.example.algorithmstudy.kotlin.HeapUtil diff --git a/app/src/test/java/com/example/algorithmstudy/PatternTest.kt b/app/src/test/java/com/example/algorithmstudy/algorithm/PatternTest.kt similarity index 91% rename from app/src/test/java/com/example/algorithmstudy/PatternTest.kt rename to app/src/test/java/com/example/algorithmstudy/algorithm/PatternTest.kt index e62fef0..fa2192e 100644 --- a/app/src/test/java/com/example/algorithmstudy/PatternTest.kt +++ b/app/src/test/java/com/example/algorithmstudy/algorithm/PatternTest.kt @@ -1,4 +1,4 @@ -package com.example.algorithmstudy +package com.example.algorithmstudy.algorithm import com.example.algorithmstudy.pattern.creation.factory.Car import org.junit.Test diff --git a/app/src/test/java/com/example/algorithmstudy/QueueTest.kt b/app/src/test/java/com/example/algorithmstudy/algorithm/QueueTest.kt similarity index 91% rename from app/src/test/java/com/example/algorithmstudy/QueueTest.kt rename to app/src/test/java/com/example/algorithmstudy/algorithm/QueueTest.kt index e95c350..73c9aaf 100644 --- a/app/src/test/java/com/example/algorithmstudy/QueueTest.kt +++ b/app/src/test/java/com/example/algorithmstudy/algorithm/QueueTest.kt @@ -1,4 +1,4 @@ -package com.example.algorithmstudy +package com.example.algorithmstudy.algorithm import com.example.algorithmstudy.java.QueueSolution import com.example.algorithmstudy.kotlin.QueueUtil diff --git a/app/src/test/java/com/example/algorithmstudy/SearchTest.kt b/app/src/test/java/com/example/algorithmstudy/algorithm/SearchTest.kt similarity index 88% rename from app/src/test/java/com/example/algorithmstudy/SearchTest.kt rename to app/src/test/java/com/example/algorithmstudy/algorithm/SearchTest.kt index f273057..cd91d7f 100644 --- a/app/src/test/java/com/example/algorithmstudy/SearchTest.kt +++ b/app/src/test/java/com/example/algorithmstudy/algorithm/SearchTest.kt @@ -1,4 +1,4 @@ -package com.example.algorithmstudy +package com.example.algorithmstudy.algorithm import com.example.algorithmstudy.kotlin.SearchUtil import org.junit.Test diff --git a/app/src/test/java/com/example/algorithmstudy/SortTest.kt b/app/src/test/java/com/example/algorithmstudy/algorithm/SortTest.kt similarity index 97% rename from app/src/test/java/com/example/algorithmstudy/SortTest.kt rename to app/src/test/java/com/example/algorithmstudy/algorithm/SortTest.kt index cb036e4..6c2bdc8 100644 --- a/app/src/test/java/com/example/algorithmstudy/SortTest.kt +++ b/app/src/test/java/com/example/algorithmstudy/algorithm/SortTest.kt @@ -1,4 +1,4 @@ -package com.example.algorithmstudy +package com.example.algorithmstudy.algorithm import com.example.algorithmstudy.kotlin.SortUtil import org.junit.Test diff --git a/app/src/test/java/com/example/algorithmstudy/AbstractFactoryTest.kt b/app/src/test/java/com/example/algorithmstudy/design_pattern/AbstractFactoryTest.kt similarity index 87% rename from app/src/test/java/com/example/algorithmstudy/AbstractFactoryTest.kt rename to app/src/test/java/com/example/algorithmstudy/design_pattern/AbstractFactoryTest.kt index 009d6f4..988b48f 100644 --- a/app/src/test/java/com/example/algorithmstudy/AbstractFactoryTest.kt +++ b/app/src/test/java/com/example/algorithmstudy/design_pattern/AbstractFactoryTest.kt @@ -1,4 +1,4 @@ -package com.example.algorithmstudy +package com.example.algorithmstudy.design_pattern import com.example.algorithmstudy.pattern.creation.abstract_factory.HQ import com.example.algorithmstudy.pattern.creation.abstract_factory.InfantryUnits diff --git a/app/src/test/java/com/example/algorithmstudy/design_pattern/PrototypeTest.kt b/app/src/test/java/com/example/algorithmstudy/design_pattern/PrototypeTest.kt new file mode 100644 index 0000000..42acc18 --- /dev/null +++ b/app/src/test/java/com/example/algorithmstudy/design_pattern/PrototypeTest.kt @@ -0,0 +1,21 @@ +package com.example.algorithmstudy.design_pattern + +import com.example.algorithmstudy.pattern.creation.prototype.MyComputer +import org.junit.Test + +class PrototypeTest { + + @Test + fun testPrototype() { + val myOriginalPc = MyComputer( + motherBoard = "Asus", + cpu = "Intel", + ram = "8GB", + graphicCard = "Nvidia" + ) + + println(myOriginalPc) + println(myOriginalPc.copy(graphicCard = "Rygen")) + + } +} \ No newline at end of file