/Source/Bifrost.Specs/Configuration/Xml/for_ConfigParser/when_config_object_has_a_string_property_and_no_xml_setting_it.cs

# · C# · 20 lines · 16 code · 4 blank · 0 comment · 0 complexity · 5832ca296fbb28c6e73bc39b9b775410 MD5 · raw file

  1. using System.Xml.Linq;
  2. using Machine.Specifications;
  3. namespace Bifrost.Specs.Configuration.Xml.for_ConfigParser
  4. {
  5. public class when_config_object_has_a_string_property_and_no_xml_setting_it : given.a_config_parser
  6. {
  7. static XDocument document;
  8. static ConfigObjectWithStringProperty config;
  9. Establish context = () =>
  10. {
  11. document = XDocument.Parse("<ConfigObjectWithStringProperty/>");
  12. };
  13. Because of = () => config = parser.Parse<ConfigObjectWithStringProperty>(document);
  14. It should_not_set_property = () => config.Something.ShouldBeNull();
  15. }
  16. }