Ejemplo n.º 1
0
        public void use_specific_formatters()
        {
            theOutputNode.UseFormatter <JsonFormatter>();
            theOutputNode.UseFormatter <XmlFormatter>();

            theFormatterMediaReader.EnumerableDependenciesOf <IFormatter>()
            .Items
            .Select(x => x.Type)
            .ShouldHaveTheSameElementsAs(typeof(JsonFormatter), typeof(XmlFormatter));
        }
Ejemplo n.º 2
0
        public ChainedBehaviorExpression OutputToJson()
        {
            var outputNode = new ConnegOutputNode(_outputType);

            outputNode.UseFormatter <JsonFormatter>();

            return(returnChain(outputNode));
        }
Ejemplo n.º 3
0
        public void use_all_formatters_clears_out_any_previously_selected_formatters()
        {
            var node = new ConnegOutputNode(typeof(Address));

            node.UseFormatter <JsonFormatter>();

            node.UseAllFormatters();

            node.SelectedFormatterTypes.Any().ShouldBeFalse();
        }
Ejemplo n.º 4
0
        public void add_a_formatter_changes_the_formatter_usage_to_selected_and_adds_the_reader_to_its_collection()
        {
            var node = new ConnegOutputNode(typeof(Address));

            node.UseFormatter <JsonFormatter>();

            node.FormatterUsage.ShouldEqual(FormatterUsage.selected);

            node.SelectedFormatterTypes.Single().ShouldEqual(typeof(JsonFormatter));
        }