public void WriteHeadersFromXElementTest() { XElement parentNode = _parentNodes[0]; string expected = expectedXmlHeaders; string actual = CSVFormatter_Accessor.WriteHeaders(parentNode, null); Assert.AreEqual(expected, actual); }
public void WriteHeadersFromRulesTest() { XElement parentNode = _parentNodes[0]; string expected = expectedFormatRuleHeaders; string actual; actual = CSVFormatter_Accessor.WriteHeaders(parentNode, _rules); Assert.AreEqual(expected, actual); }
public void FormatMapTest() { string fieldValue = "Call"; ICSVFormatRule rule = _rules[6]; // optiontype string expected = "C"; string actual; actual = CSVFormatter_Accessor.FormatField(fieldValue, rule); Assert.AreEqual(expected, actual); }
public void FormatDateTest() { string fieldValue = "2013-10-01"; ICSVFormatRule rule = _rules[5]; // expirationdate string expected = "10/1/2013"; string actual; actual = CSVFormatter_Accessor.FormatField(fieldValue, rule); Assert.AreEqual(expected, actual); }
public void FormatNumericTest() { string fieldValue = "20"; ICSVFormatRule rule = _rules[4]; // strikeprice string expected = "20.00"; string actual; actual = CSVFormatter_Accessor.FormatField(fieldValue, rule); Assert.AreEqual(expected, actual); }
public void FormatConstantTest() { string fieldValue = string.Empty; ICSVFormatRule rule = _rules[0]; // account string expected = "Adar"; string actual; actual = CSVFormatter_Accessor.FormatField(fieldValue, rule); Assert.AreEqual(expected, actual); }
public void FormatErrorTest() { string fieldValue = "20"; CSVFormatRule rule = new CSVFormatRule { ColumnName = "Strike", MappedName = "StrikePrice", FormatString = "{1:f2}", FormatType = CSVFormatType.Numeric }; string expected = string.Format(CSVErrorMessages_Accessor.ErrorMsgFormatError, fieldValue, rule.FormatString); string actual; actual = CSVFormatter_Accessor.FormatField(fieldValue, rule); Assert.AreEqual(expected, actual); }