public void needs_renumbering_is_true_because_there_are_duplicate_ids() { var spec = new Specification(); var c1 = new Comment(); spec.Children.Add(c1); var section1 = new Section("Foo"); var s1 = section1.AddStep("foo1"); var s2 = section1.AddStep("foo1"); var s3 = section1.AddStep("foo1"); var section2 = s3.AddCollection("rows"); var s4 = section2.AddStep("r1"); var s5 = section2.AddStep("r1"); var s6 = section2.AddStep("r1"); s4.id = s5.id = s6.id = Guid.NewGuid().ToString(); spec.Children.Add(section1); var c2 = new Comment(); spec.Children.Add(c2); spec.NeedsToBeRenumbered().ShouldBeTrue(); }
public void needs_renumbering_negative() { var spec = new Specification(); var c1 = new Comment(); spec.Children.Add(c1); var section1 = new Section("Foo"); var s1 = section1.AddStep("foo1"); var s2 = section1.AddStep("foo1"); var s3 = section1.AddStep("foo1"); var section2 = s3.AddCollection("rows"); var s4 = section2.AddStep("r1"); var s5 = section2.AddStep("r1"); var s6 = section2.AddStep("r1"); spec.Children.Add(section1); var c2 = new Comment(); spec.Children.Add(c2); spec.NeedsToBeRenumbered().ShouldBeFalse(); }