public void NameOnly()
        {
            var tree = new MarkupExtensionNode(new IdentifierNode("DummyExtension"));
            var sut = new MarkupExtensionNodeToXamlNodesConverter(WiringContext);
            var actualNodes = sut.Convert(tree).ToList();
            var expectedNodes = new List<XamlNode>
            {
                x.StartObject<DummyExtension>(),
                x.EndObject(),
            };

            CollectionAssert.AreEqual(expectedNodes, actualNodes);
        }
        public void NameAndAttribute()
        {
            var tree = new MarkupExtensionNode(new IdentifierNode("DummyExtension"), new OptionsCollection {new PropertyOption("Property", new StringNode("Value"))});
            var sut = new MarkupExtensionNodeToXamlNodesConverter(WiringContext);
            var actualNodes = sut.Convert(tree).ToList();

            var expectedNodes = new List<XamlNode>
            {
                x.StartObject<DummyExtension>(),
                x.StartMember<DummyExtension>(d => d.Property),
                x.Value("Value"),
                x.EndMember(),
                x.EndObject(),
            };

            CollectionAssert.AreEqual(expectedNodes, actualNodes);
        }
        public void NameAndAttribute()
        {
            var tree = new MarkupExtensionNode(new IdentifierNode("DummyExtension"), new OptionsCollection {new PropertyOption("Property", new StringNode("Value"))});
            var sut = new MarkupExtensionNodeToXamlNodesConverter(TypeRuntimeTypeSource);
            var actualNodes = sut.ParseMarkupExtensionNode(tree).ToList();

            var expectedInstructions = new List<Instruction>
            {
                X.StartObject<DummyExtension>(),
                X.StartMember<DummyExtension>(d => d.Property),
                X.Value("Value"),
                X.EndMember(),
                X.EndObject(),
            };

            CollectionAssert.AreEqual(expectedInstructions, actualNodes);
        }
        public void ComposedExtensionTemplateBindingWithConverter()
        {
            var tree = MarkupExtensionNodeResources.ComposedExtensionTemplateBindingWithConverter();
            var sut = new MarkupExtensionNodeToXamlNodesConverter(WiringContext);
            var actualNodes = sut.ParseMarkupExtensionNode(tree).ToList();

            var expectedInstructions = new Collection<XamlInstruction>
            {
                X.StartObject<TemplateBindingExtension>(),
                    X.StartMember<TemplateBindingExtension>(d => d.Path),
                        X.Value("IsFloatingWatermarkVisible"),
                    X.EndMember(),
                    X.StartMember<TemplateBindingExtension>(d => d.Converter),
                        X.StartObject<TypeExtension>(),
                            X.MarkupExtensionArguments(),
                                X.Value("FooBar"),
                            X.EndMember(),
                        X.EndObject(),
                    X.EndMember(),
                X.EndObject(),
            };

            CollectionAssert.AreEqual(expectedInstructions, actualNodes);
        }
        public void PositionalOption()
        {
            var tree = new MarkupExtensionNode(new IdentifierNode("DummyExtension"), new OptionsCollection
            {
               new PositionalOption("Option")
            });
            var sut = new MarkupExtensionNodeToXamlNodesConverter(WiringContext);
            var actualNodes = sut.Convert(tree).ToList();

            var expectedNodes = new Collection<XamlNode>
            {
                x.StartObject<DummyExtension>(),
                x.MarkupExtensionArguments(),
                x.Value("Option"),
                x.EndMember(),
                x.EndObject(),
            };

            CollectionAssert.AreEqual(expectedNodes, actualNodes);
        }
        public void NameOnly()
        {
            var tree = new MarkupExtensionNode(new IdentifierNode("DummyExtension"));
            var sut = new MarkupExtensionNodeToXamlNodesConverter(TypeRuntimeTypeSource);
            var actualNodes = sut.ParseMarkupExtensionNode(tree).ToList();
            var expectedInstructions = new List<Instruction>
            {
                X.StartObject<DummyExtension>(),
                X.EndObject(),
            };

            CollectionAssert.AreEqual(expectedInstructions, actualNodes);
        }
        public void PositionalOption()
        {
            var tree = new MarkupExtensionNode(new IdentifierNode("DummyExtension"), new OptionsCollection
            {
               new PositionalOption("Option")
            });
            var sut = new MarkupExtensionNodeToXamlNodesConverter(TypeRuntimeTypeSource);
            var actualNodes = sut.ParseMarkupExtensionNode(tree).ToList();

            var expectedInstructions = new Collection<Instruction>
            {
                X.StartObject<DummyExtension>(),
                X.MarkupExtensionArguments(),
                X.Value("Option"),
                X.EndMember(),
                X.EndObject(),
            };

            CollectionAssert.AreEqual(expectedInstructions, actualNodes);
        }