public void GetAllXmlTest() { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?> <function controlid=""unittest""> <runDdsJob> <object>GLACCOUNT</object> <cloudDelivery>My Cloud Bucket</cloudDelivery> <jobType>change</jobType> <timeStamp>2002-09-24T06:00:00</timeStamp> <fileConfiguration> <delimiter>,</delimiter> <enclosure>""</enclosure> <includeHeaders>true</includeHeaders> <fileFormat>unix</fileFormat> <splitSize>10000</splitSize> <compress>false</compress> </fileConfiguration> </runDdsJob> </function>"; Stream stream = new MemoryStream(); XmlWriterSettings xmlSettings = new XmlWriterSettings(); xmlSettings.Encoding = Encoding.UTF8; xmlSettings.Indent = true; xmlSettings.IndentChars = " "; IaXmlWriter xml = new IaXmlWriter(stream, xmlSettings); DdsJobCreate runJob = new DdsJobCreate("unittest"); runJob.ObjectName = "GLACCOUNT"; runJob.CloudDeliveryName = "My Cloud Bucket"; runJob.JobType = "change"; runJob.Timestamp = new DateTime(2002, 09, 24, 06, 0, 0); runJob.Delimiter = ","; runJob.Enclosure = "\""; runJob.IncludeHeaders = true; runJob.FileFormat = "unix"; runJob.SplitSize = 10000; runJob.Compressed = false; runJob.WriteXml(ref xml); xml.Flush(); stream.Position = 0; StreamReader reader = new StreamReader(stream); Diff xmlDiff = DiffBuilder.Compare(expected).WithTest(reader.ReadToEnd()) .WithDifferenceEvaluator(DifferenceEvaluators.Default) .Build(); Assert.IsFalse(xmlDiff.HasDifferences(), xmlDiff.ToString()); }
public void GetXmlTest() { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?> <function controlid=""unittest""> <runDdsJob> <object>GLACCOUNT</object> <cloudDelivery>My Cloud Bucket</cloudDelivery> <jobType>all</jobType> <fileConfiguration /> </runDdsJob> </function>"; DdsJobCreate record = new DdsJobCreate("unittest") { ObjectName = "GLACCOUNT", CloudDeliveryName = "My Cloud Bucket", JobType = "all" }; this.CompareXml(expected, record); }
public void GetXmlTest() { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?> <function controlid=""unittest""> <runDdsJob> <object>GLACCOUNT</object> <cloudDelivery>My Cloud Bucket</cloudDelivery> <jobType>all</jobType> <fileConfiguration /> </runDdsJob> </function>"; Stream stream = new MemoryStream(); XmlWriterSettings xmlSettings = new XmlWriterSettings(); xmlSettings.Encoding = Encoding.UTF8; xmlSettings.Indent = true; xmlSettings.IndentChars = " "; IaXmlWriter xml = new IaXmlWriter(stream, xmlSettings); DdsJobCreate runJob = new DdsJobCreate("unittest"); runJob.ObjectName = "GLACCOUNT"; runJob.CloudDeliveryName = "My Cloud Bucket"; runJob.JobType = "all"; runJob.WriteXml(ref xml); xml.Flush(); stream.Position = 0; StreamReader reader = new StreamReader(stream); Diff xmlDiff = DiffBuilder.Compare(expected).WithTest(reader.ReadToEnd()) .WithDifferenceEvaluator(DifferenceEvaluators.Default) .Build(); Assert.IsFalse(xmlDiff.HasDifferences(), xmlDiff.ToString()); }
public void GetAllXmlTest() { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?> <function controlid=""unittest""> <runDdsJob> <object>GLACCOUNT</object> <cloudDelivery>My Cloud Bucket</cloudDelivery> <jobType>change</jobType> <timeStamp>2002-09-24T06:00:00</timeStamp> <fileConfiguration> <delimiter>,</delimiter> <enclosure>""</enclosure> <includeHeaders>true</includeHeaders> <fileFormat>unix</fileFormat> <splitSize>10000</splitSize> <compress>false</compress> </fileConfiguration> </runDdsJob> </function>"; DdsJobCreate record = new DdsJobCreate("unittest") { ObjectName = "GLACCOUNT", CloudDeliveryName = "My Cloud Bucket", JobType = "change", Timestamp = new DateTime(2002, 09, 24, 06, 0, 0), Delimiter = ",", Enclosure = "\"", IncludeHeaders = true, FileFormat = "unix", SplitSize = 10000, Compressed = false }; this.CompareXml(expected, record); }