public void GetOrderedJobListTest_TwoJobs2() { // arrange var jobString = "a=>b;b"; var expected = new List <Job> { jobB, jobA }; var jobsSorter = JobsSorterBuilder.CreateJobsSorter(); // act var actual = jobsSorter.GetOrderedJobList(jobString.ToUpper()); // assert CollectionAssert.AreEqual(expected, actual, new JobsComparerByName()); }
public void GetOrderedJobListTest_ConsistencyError() { // arrange var jobString = "a=>a"; var expected = "Error: the job list is not coherent"; var jobsSorter = JobsSorterBuilder.CreateJobsSorter(); // act try { var actual = jobsSorter.GetOrderedJobList(jobString.ToUpper()); } catch (Exception e) { // assert Assert.AreEqual(expected, e.Message); } }
public void GetOrderedJobListTest_CircularDependencyError() { // arrange var jobString = "a=>b;b=>c;c=>a"; var expected = "Error: There is atleast one cyclic dependency"; var jobsSorter = JobsSorterBuilder.CreateJobsSorter(); // act try { var actual = jobsSorter.GetOrderedJobList(jobString.ToUpper()); } catch (Exception e) { // assert Assert.AreEqual(expected, e.Message); } }
public void GetOrderedJobListTest_SyntaxError() { // arrange var jobString = "a$b"; var expected = "Error: wrong syntax"; var jobsSorter = JobsSorterBuilder.CreateJobsSorter(); // act try { var actual = jobsSorter.GetOrderedJobList(jobString.ToUpper()); } catch (Exception e) { // assert Assert.AreEqual(expected, e.Message); } }