public void When_formatting_an_attribute_it_should_return_the_name_and_value() { // Arrange var formatter = new XAttributeValueFormatter(); // Act var element = XElement.Parse(@"<person name=""Martin"" age=""36"" />"); XAttribute attribute = element.Attribute("name"); string result = formatter.Format(attribute, new FormattingContext(), null); // Assert result.Should().Be(@"name=""Martin"""); }
public void When_formatting_an_attribute_it_should_return_the_name_and_value() { //----------------------------------------------------------------------------------------------------------- // Arrange //----------------------------------------------------------------------------------------------------------- var formatter = new XAttributeValueFormatter(); //----------------------------------------------------------------------------------------------------------- // Act //----------------------------------------------------------------------------------------------------------- var element = XElement.Parse(@"<person name=""Martin"" age=""36"" />"); XAttribute attribute = element.Attribute("name"); string result = formatter.ToString(attribute, false); //----------------------------------------------------------------------------------------------------------- // Assert //----------------------------------------------------------------------------------------------------------- result.Should().Be(@"name=""Martin"""); }