public void JobParser_ValidJobWithParent_ShouldParse() { IJobParser parser = new JobParser(); var result = parser.Parse("A => B"); Assert.AreEqual(result.JobId, "A"); Assert.AreEqual(result.DependantJobId, "B"); }
/// <summary> /// Create a new instance of RepairInfo. /// </summary> /// <param name="nodes">Collection of HtmlNodes with relevant information.</param> public RepairInfo(HtmlNodeCollection nodes) { var repair = nodes[2].LastChild.InnerText; var jobString = repair.Substring(0, repair.IndexOf(" ")); var lvString = repair.Substring(repair.LastIndexOf(" ") + 1); var grade = nodes[3].LastChild.InnerText[6].ToString(); Job = JobParser.Parse(jobString); Level = int.Parse(lvString); MaterialGrade = int.Parse(grade); }
public void JobParser_ValidJobWithWrongNoImpliesArgument_ShouldError() { IJobParser parser = new JobParser(); var result = parser.Parse("A B C"); }
public void JobParser_ValidJobWithWrongSecondArgument_ShouldError() { IJobParser parser = new JobParser(); var result = parser.Parse("A B"); }
public void JobParser_ValidJobWithoutImplies_ShouldError() { IJobParser parser = new JobParser(); var result = parser.Parse("A = B"); }
public void JobParser_ValidJobWithMoreThanThreeParameters_ShouldError() { IJobParser parser = new JobParser(); var result = parser.Parse("A B C B"); }
public void JobParser_ValidJobWithEmpty_ShouldError() { IJobParser parser = new JobParser(); var result = parser.Parse(""); }