Beispiel #1
0
        public void MaximumTest()
        {
            string expected = @"<?xml version=""1.0"" encoding=""utf-8""?>" +
                              "<max>PRICE</max>";

            Stream            stream      = new MemoryStream();
            XmlWriterSettings xmlSettings = new XmlWriterSettings
            {
                Encoding = Encoding.GetEncoding("UTF-8")
            };

            IaXmlWriter   xml     = new IaXmlWriter(stream, xmlSettings);
            SelectBuilder builder = new SelectBuilder();

            ISelect[] fields = builder.Maximum("PRICE").GetFields();

            foreach (var field in fields)
            {
                field.WriteXml(ref xml);
            }

            xml.Flush();

            stream.Position = 0;
            StreamReader reader = new StreamReader(stream);

            Assert.Equal(expected, reader.ReadToEnd());
        }