public void GetXmlTest() { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?> <expenseadjustment> <glaccountno /> <amount /> </expenseadjustment>"; Stream stream = new MemoryStream(); XmlWriterSettings xmlSettings = new XmlWriterSettings(); xmlSettings.Encoding = Encoding.UTF8; xmlSettings.Indent = true; xmlSettings.IndentChars = " "; IaXmlWriter xml = new IaXmlWriter(stream, xmlSettings); ExpenseAdjustmentLineCreate line = new ExpenseAdjustmentLineCreate(); line.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""> <create_expenseadjustmentreport> <employeeid>E0001</employeeid> <datecreated> <year>2015</year> <month>06</month> <day>30</day> </datecreated> <expenseadjustments> <expenseadjustment> <glaccountno /> <amount /> </expenseadjustment> </expenseadjustments> </create_expenseadjustmentreport> </function>"; ExpenseAdjustmentCreate record = new ExpenseAdjustmentCreate("unittest") { EmployeeId = "E0001", TransactionDate = new DateTime(2015, 06, 30) }; ExpenseAdjustmentLineCreate line1 = new ExpenseAdjustmentLineCreate(); record.Lines.Add(line1); this.CompareXml(expected, record); }
public void GetXmlTest() { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?> <expenseadjustment> <glaccountno /> <amount /> </expenseadjustment>"; ExpenseAdjustmentLineCreate record = new ExpenseAdjustmentLineCreate(); this.CompareXml(expected, record); }
public void GetAllXmlTest() { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?> <function controlid=""unittest""> <create_expenseadjustmentreport> <employeeid>E0001</employeeid> <datecreated> <year>2015</year> <month>06</month> <day>30</day> </datecreated> <dateposted> <year>2015</year> <month>06</month> <day>30</day> </dateposted> <batchkey>123</batchkey> <adjustmentno>ADJ001</adjustmentno> <docnumber>EXP001</docnumber> <description>For hotel</description> <basecurr>USD</basecurr> <currency>USD</currency> <expenseadjustments> <expenseadjustment> <glaccountno /> <amount /> </expenseadjustment> </expenseadjustments> <supdocid>AT122</supdocid> </create_expenseadjustmentreport> </function>"; ExpenseAdjustmentCreate record = new ExpenseAdjustmentCreate("unittest") { EmployeeId = "E0001", TransactionDate = new DateTime(2015, 06, 30), GlPostingDate = new DateTime(2015, 06, 30), SummaryRecordNo = 123, ExpenseAdjustmentNumber = "ADJ001", ExpenseReportNumber = "EXP001", Description = "For hotel", BaseCurrency = "USD", ReimbursementCurrency = "USD", AttachmentsId = "AT122" }; ExpenseAdjustmentLineCreate line1 = new ExpenseAdjustmentLineCreate(); record.Lines.Add(line1); this.CompareXml(expected, record); }
public void GetXmlTest() { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?> <function controlid=""unittest""> <create_expenseadjustmentreport> <employeeid>E0001</employeeid> <datecreated> <year>2015</year> <month>06</month> <day>30</day> </datecreated> <expenseadjustments> <expenseadjustment> <glaccountno /> <amount /> </expenseadjustment> </expenseadjustments> </create_expenseadjustmentreport> </function>"; Stream stream = new MemoryStream(); XmlWriterSettings xmlSettings = new XmlWriterSettings(); xmlSettings.Encoding = Encoding.UTF8; xmlSettings.Indent = true; xmlSettings.IndentChars = " "; IaXmlWriter xml = new IaXmlWriter(stream, xmlSettings); ExpenseAdjustmentCreate record = new ExpenseAdjustmentCreate("unittest"); record.EmployeeId = "E0001"; record.TransactionDate = new DateTime(2015, 06, 30); ExpenseAdjustmentLineCreate line1 = new ExpenseAdjustmentLineCreate(); record.Lines.Add(line1); record.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""?> <expenseadjustment> <glaccountno>7000</glaccountno> <amount>1025.99</amount> <currency>USD</currency> <trx_amount>76343.43</trx_amount> <exchratedate> <year>2016</year> <month>06</month> <day>30</day> </exchratedate> <exchratetype>Intacct Daily Rate</exchratetype> <expensedate> <year>2016</year> <month>06</month> <day>30</day> </expensedate> <memo>Marriott</memo> <locationid>Location1</locationid> <departmentid>Department1</departmentid> <projectid>Project1</projectid> <customerid>Customer1</customerid> <vendorid>Vendor1</vendorid> <employeeid>Employee1</employeeid> <itemid>Item1</itemid> <classid>Class1</classid> <contractid>Contract1</contractid> <warehouseid>Warehouse1</warehouseid> <billable>true</billable> <exppmttype>AMEX</exppmttype> <quantity>10</quantity> <rate>12.34</rate> <customfields> <customfield> <customfieldname>customfield1</customfieldname> <customfieldvalue>customvalue1</customfieldvalue> </customfield> </customfields> </expenseadjustment>"; ExpenseAdjustmentLineCreate record = new ExpenseAdjustmentLineCreate() { GlAccountNumber = "7000", ReimbursementAmount = 1025.99M, TransactionCurrency = "USD", TransactionAmount = 76343.43M, ExchangeRateDate = new DateTime(2016, 06, 30), ExchangeRateType = "Intacct Daily Rate", ExpenseDate = new DateTime(2016, 06, 30), Memo = "Marriott", Billable = true, PaymentTypeName = "AMEX", Quantity = 10, UnitRate = 12.34M, LocationId = "Location1", DepartmentId = "Department1", ProjectId = "Project1", CustomerId = "Customer1", VendorId = "Vendor1", EmployeeId = "Employee1", ItemId = "Item1", ClassId = "Class1", ContractId = "Contract1", WarehouseId = "Warehouse1", CustomFields = new Dictionary <string, dynamic> { { "customfield1", "customvalue1" } } }; this.CompareXml(expected, record); }
public void GetAllXmlTest() { string expected = @"<?xml version=""1.0"" encoding=""utf-8""?> <expenseadjustment> <glaccountno>7000</glaccountno> <amount>1025.99</amount> <currency>USD</currency> <trx_amount>76343.43</trx_amount> <exchratedate> <year>2016</year> <month>06</month> <day>30</day> </exchratedate> <exchratetype>Intacct Daily Rate</exchratetype> <expensedate> <year>2016</year> <month>06</month> <day>30</day> </expensedate> <memo>Marriott</memo> <locationid>Location1</locationid> <departmentid>Department1</departmentid> <projectid>Project1</projectid> <customerid>Customer1</customerid> <vendorid>Vendor1</vendorid> <employeeid>Employee1</employeeid> <itemid>Item1</itemid> <classid>Class1</classid> <contractid>Contract1</contractid> <warehouseid>Warehouse1</warehouseid> <billable>true</billable> <exppmttype>AMEX</exppmttype> <quantity>10</quantity> <rate>12.34</rate> <customfields> <customfield> <customfieldname>customfield1</customfieldname> <customfieldvalue>customvalue1</customfieldvalue> </customfield> </customfields> </expenseadjustment>"; Stream stream = new MemoryStream(); XmlWriterSettings xmlSettings = new XmlWriterSettings(); xmlSettings.Encoding = Encoding.UTF8; xmlSettings.Indent = true; xmlSettings.IndentChars = " "; IaXmlWriter xml = new IaXmlWriter(stream, xmlSettings); ExpenseAdjustmentLineCreate record = new ExpenseAdjustmentLineCreate() { GlAccountNumber = "7000", ReimbursementAmount = 1025.99M, TransactionCurrency = "USD", TransactionAmount = 76343.43M, ExchangeRateDate = new DateTime(2016, 06, 30), ExchangeRateType = "Intacct Daily Rate", ExpenseDate = new DateTime(2016, 06, 30), Memo = "Marriott", Billable = true, PaymentTypeName = "AMEX", Quantity = 10, UnitRate = 12.34M, LocationId = "Location1", DepartmentId = "Department1", ProjectId = "Project1", CustomerId = "Customer1", VendorId = "Vendor1", EmployeeId = "Employee1", ItemId = "Item1", ClassId = "Class1", ContractId = "Contract1", WarehouseId = "Warehouse1", CustomFields = new Dictionary <string, dynamic> { { "customfield1", "customvalue1" } } }; record.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""> <create_expenseadjustmentreport> <employeeid>E0001</employeeid> <datecreated> <year>2015</year> <month>06</month> <day>30</day> </datecreated> <dateposted> <year>2015</year> <month>06</month> <day>30</day> </dateposted> <batchkey>123</batchkey> <adjustmentno>ADJ001</adjustmentno> <docnumber>EXP001</docnumber> <description>For hotel</description> <basecurr>USD</basecurr> <currency>USD</currency> <expenseadjustments> <expenseadjustment> <glaccountno /> <amount /> </expenseadjustment> </expenseadjustments> <supdocid>AT122</supdocid> </create_expenseadjustmentreport> </function>"; Stream stream = new MemoryStream(); XmlWriterSettings xmlSettings = new XmlWriterSettings(); xmlSettings.Encoding = Encoding.UTF8; xmlSettings.Indent = true; xmlSettings.IndentChars = " "; IaXmlWriter xml = new IaXmlWriter(stream, xmlSettings); ExpenseAdjustmentCreate record = new ExpenseAdjustmentCreate("unittest") { EmployeeId = "E0001", TransactionDate = new DateTime(2015, 06, 30), GlPostingDate = new DateTime(2015, 06, 30), SummaryRecordNo = 123, ExpenseAdjustmentNumber = "ADJ001", ExpenseReportNumber = "EXP001", Description = "For hotel", BaseCurrency = "USD", ReimbursementCurrency = "USD", AttachmentsId = "AT122" }; ExpenseAdjustmentLineCreate line1 = new ExpenseAdjustmentLineCreate(); record.Lines.Add(line1); record.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()); }