예제 #1
0
        void VerifyComposite()
        {
            IConfigurationContainer container = ConfiguredContainer.New <ComplexProfile>();

            IExtendedXmlSerializer serializer = container.UseAutoFormatting()
                                                .EnableImplicitTyping(typeof(Subject))
                                                .UseOptimizedNamespaces()
                                                .Create();
            var instance = new Subject {
                Message = "Hello World!", Number = 123
            };
            string document = serializer.Serialize(instance);

            document.Should()
            .Be(@"<?xml version=""1.0"" encoding=""utf-8""?><Issue282Tests_Profiles-Subject NewNumber=""123"" NewMessage=""Hello World!"" />");
        }