public void add_spec_with_illegal_chars() { var c = Path.GetInvalidFileNameChars().First(); var added = ClassUnderTest.AddSpec("Sentences", $"The Third Sentence{c}{c}"); var expectedPath = thePath.AppendPath("Sentences", "The_Third_Sentence.md"); added.data.name.ShouldBe($"The Third Sentence{c}{c}"); added.data.Filename.ShouldBe(expectedPath); added.data.Lifecycle.ShouldBe(Lifecycle.Acceptance); added.data.Filename.ShouldBe(expectedPath); ClassUnderTest.Hierarchy.Specifications[added.data.id].ShouldBeTheSameAs(added.data); var specification = MarkdownReader.ReadFromFile(expectedPath); specification.name.ShouldBe($"The Third Sentence{c}{c}"); // Adds the spec to the node var suite = ClassUnderTest.Hierarchy.Suites["Sentences"]; suite.Specifications.ShouldContain(added.data); }
public void add_spec_with_illegal_chars() { var added = ClassUnderTest.AddSpec("Sentences", "The Third Sentence??"); var expectedPath = thePath.AppendPath("Sentences", "The_Third_Sentence.xml"); added.data.name.ShouldBe("The Third Sentence??"); added.data.Filename.ShouldBe(expectedPath); added.data.Lifecycle.ShouldBe(Lifecycle.Acceptance); added.data.Filename.ShouldBe(expectedPath); ClassUnderTest.Hierarchy.Specifications[added.data.id].ShouldBeTheSameAs(added.data); var specification = XmlReader.ReadFromFile(expectedPath); specification.name.ShouldBe("The Third Sentence??"); // Adds the spec to the node var suite = ClassUnderTest.Hierarchy.Suites["Sentences"]; suite.specs.ShouldContain(added.data); }