public void use_specific_formatters() { theInputNode.UseFormatter <JsonFormatter>(); theInputNode.UseFormatter <XmlFormatter>(); theFormatterMediaReader.EnumerableDependenciesOf <IFormatter>() .Items .Select(x => x.Type) .ShouldHaveTheSameElementsAs(typeof(JsonFormatter), typeof(XmlFormatter)); }
public void adding_a_formatter_is_idempotent() { var node = new ConnegInputNode(typeof(Address)); node.UseFormatter <JsonFormatter>(); node.UseFormatter <JsonFormatter>(); node.UseFormatter <JsonFormatter>(); node.UseFormatter <JsonFormatter>(); node.UseFormatter <JsonFormatter>(); node.SelectedFormatterTypes.Single().ShouldEqual(typeof(JsonFormatter)); }
public void use_all_formatters_clears_out_any_previously_selected_formatters() { var node = new ConnegInputNode(typeof(Address)); node.UseFormatter <JsonFormatter>(); node.UseAllFormatters(); node.SelectedFormatterTypes.Any().ShouldBeFalse(); }
public void add_a_formatter_changes_the_formatter_usage_to_selected_and_adds_the_reader_to_its_collection() { var node = new ConnegInputNode(typeof(Address)); node.UseFormatter <JsonFormatter>(); node.FormatterUsage.ShouldEqual(FormatterUsage.selected); node.SelectedFormatterTypes.Single().ShouldEqual(typeof(JsonFormatter)); }