File tree Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Expand file tree Collapse file tree 3 files changed +20
-3
lines changed Original file line number Diff line number Diff line change 11package main .java .com .ctci .stacksandqueues ;
22
3+ import com .ctci .stacksandqueues .StackMin ;
4+
35public class StackMinTest {
46 public static void main (String [] args ) {
5- Result result = JUnitCore .runClasses (QueueViaStacks .class );
7+ Result result = JUnitCore .runClasses (StackMin .class );
68 for (Failure failure : result .getFailures ()) {
79 System .out .println (failure .toString ());
810 }
Original file line number Diff line number Diff line change 88import java .util .Map ;
99import java .util .Set ;
1010import java .util .stream .Stream ;
11-
11+ import org . junit . Assert .*;
1212/**
1313 * You are given a list of projects and a list of dependencies (which is a list of pairs of projects, where the second
1414 * 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) {
107107 projects .forEach ((n , p ) -> p .dependencies .removeAll (newlyBuiltProjects ));
108108 }
109109
110-
110+ @ Test
111111 public static void main (String [] args ) {
112112 /* test case 1
113113
@@ -139,6 +139,8 @@ public static void main(String[] args) {
139139 buildOrder .addDependency ("b" , "a" );
140140 buildOrder .addDependency ("b" , "e" );
141141 buildOrder .addDependency ("a" , "e" );
142+ assertNull (buildOrder );
142143 System .out .println (buildOrder .getBuildOrder ());
144+
143145 }
144146}
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