File tree 3 files changed +20
-3
lines changed
3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 1
1
package main .java .com .ctci .stacksandqueues ;
2
2
3
+ import com .ctci .stacksandqueues .StackMin ;
4
+
3
5
public class StackMinTest {
4
6
public static void main (String [] args ) {
5
- Result result = JUnitCore .runClasses (QueueViaStacks .class );
7
+ Result result = JUnitCore .runClasses (StackMin .class );
6
8
for (Failure failure : result .getFailures ()) {
7
9
System .out .println (failure .toString ());
8
10
}
Original file line number Diff line number Diff line change 8
8
import java .util .Map ;
9
9
import java .util .Set ;
10
10
import java .util .stream .Stream ;
11
-
11
+ import org . junit . Assert .*;
12
12
/**
13
13
* You are given a list of projects and a list of dependencies (which is a list of pairs of projects, where the second
14
14
* project is dependent on the first project). All of a project's dependencies must be built before the project is. Find
@@ -107,7 +107,7 @@ private void removeDependency(Set<Project> newlyBuiltProjects) {
107
107
projects .forEach ((n , p ) -> p .dependencies .removeAll (newlyBuiltProjects ));
108
108
}
109
109
110
-
110
+ @ Test
111
111
public static void main (String [] args ) {
112
112
/* test case 1
113
113
@@ -139,6 +139,8 @@ public static void main(String[] args) {
139
139
buildOrder .addDependency ("b" , "a" );
140
140
buildOrder .addDependency ("b" , "e" );
141
141
buildOrder .addDependency ("a" , "e" );
142
+ assertNull (buildOrder );
142
143
System .out .println (buildOrder .getBuildOrder ());
144
+
143
145
}
144
146
}
Original file line number Diff line number Diff line change
1
+ package main .java .com .ctci .treesandgraphs ;
2
+
3
+ import com .ctci .treesandgraphs .BuildOrder ;
4
+
5
+ public class BuildOrderTest {
6
+ public static void main (String [] args ) {
7
+ Result result = JUnitCore .runClasses (BuildOrder .class );
8
+ for (Failure failure : result .getFailures ()) {
9
+ System .out .println (failure .toString ());
10
+ }
11
+ System .out .println ("Result == " +result .wasSuccessful ());
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments