private void ReadTextBlock_returns_the_expected_elements(string xml, params Element[] expectedElements) { // ARRANGE var sut = new XmlDocsReader(NullLogger.Instance, new XDocument(), Array.Empty <TypeId>()); var expected = new TextBlock(expectedElements); // ACT var actual = sut.ReadTextBlock(XElement.Parse(xml)); // ASSERT Assert.Equal(expected, actual); }
private void ReadMemberContent_correctly_parses_seealso_elements(string xml, SeeAlsoElement expected) { // ARRANGE xml = $@"<container>{xml}</container>"; var sut = new XmlDocsReader(NullLogger.Instance, new XDocument(), Array.Empty <TypeId>()); var memberElement = new MemberElement(MemberId.Parse("T:DemoProject.DemoClass", Array.Empty <TypeId>())); // ACT sut.ReadMemberContent(XElement.Parse(xml), memberElement); // ASSERT var actual = Assert.Single(memberElement.SeeAlso); Assert.Equal(expected, actual); }
private void ReadTextBlock_correctly_reads_see_elements(string xml, SeeElement expected) { // ARRANGE xml = $@"<para>{xml}</para>"; var sut = new XmlDocsReader(NullLogger.Instance, new XDocument(), Array.Empty <TypeId>()); // ACT var textBlock = sut.ReadTextBlock(XElement.Parse(xml)); // ASSERT var element = Assert.Single(textBlock.Elements); var seeElement = Assert.IsType <SeeElement>(element); Assert.Equal(expected, seeElement); }
private static ListElement ReadList(XDocument document) { var xmlDocsReader = new XmlDocsReader(NullLogger.Instance, document, Array.Empty <TypeId>()); var members = xmlDocsReader.Read(); Assert.Single(members); Assert.Single(members.Single().Summary.Elements); var element = members.Single().Summary.Elements.Single(); Assert.IsType <ListElement>(element); var list = (ListElement)element; return(list); }