Add boilerplate for root project
This commit is contained in:
parent
7739296926
commit
494bd6ff76
14
src/main/java/com/cleverthis/interview/Solution.java
Normal file
14
src/main/java/com/cleverthis/interview/Solution.java
Normal file
@ -0,0 +1,14 @@
|
||||
package com.cleverthis.interview;
|
||||
|
||||
import com.cleverthis.interview.padlock.PadlockImpl;
|
||||
import sun.reflect.generics.reflectiveObjects.NotImplementedException;
|
||||
|
||||
/**
|
||||
* This is a placeholder class showing a simple boilerplate.
|
||||
* This class is not required, so you can replace with your own architecture.
|
||||
* */
|
||||
public class Solution {
|
||||
public void solve(PadlockImpl padlock) {
|
||||
throw new RuntimeException("TODO");
|
||||
}
|
||||
}
|
30
src/test/java/com/cleverthis/interview/SolutionTest.java
Normal file
30
src/test/java/com/cleverthis/interview/SolutionTest.java
Normal file
@ -0,0 +1,30 @@
|
||||
package com.cleverthis.interview;
|
||||
|
||||
import com.cleverthis.interview.padlock.PadlockImpl;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
|
||||
/**
|
||||
* This is a simple placeholder to show how unit test works.
|
||||
* You can replace it with your own test.
|
||||
*/
|
||||
class SolutionTest {
|
||||
private void solve(PadlockImpl padlock) {
|
||||
new Solution().solve(padlock);
|
||||
}
|
||||
|
||||
@Test
|
||||
void verify(){
|
||||
Random random = new Random();
|
||||
PadlockImpl padlock = new PadlockImpl(random.nextInt(1, 8));
|
||||
|
||||
long startTime = System.currentTimeMillis();
|
||||
solve(padlock);
|
||||
long endTime = System.currentTimeMillis();
|
||||
assertTrue(padlock.isPasscodeCorrect());
|
||||
System.out.println("Time usage: " + (endTime - startTime) + "ms");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user