public void apply_renumbering() { 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.ApplyRenumbering(); s4.id.ShouldNotBe(s5.id); s5.id.ShouldNotBe(s6.id); s4.id.ShouldNotBe(s6.id); }
private void roundTripCheck(Specification spec) { spec.ApplyRenumbering(); spec.path = null; // doesn't matter for the markdown persistence var markdown = MarkdownWriter.WriteToText(spec); var readCopy = MarkdownReader.ReadFromText(markdown); compare(spec, readCopy); }