Esempio n. 1
0
        public void ShouldNotCreatePaymentWhenAccountIsInvalid()
        {
            try
            {
                Payment payment = new Payment(null, 100.50M, DateTime.Parse("2011-03-01T17:01:37.9575406+05:30"));
                Assert.Fail();
            }
            catch (Exception)
            {

            }
        }
 private void CreateOutputXml(Payment payment)
 {
     using (var writer = new XmlTextWriter(OutputPath + counter + ".xml", null))
     {
         counter++;
         writer.WriteStartElement("payment-instruction");
         WriteElement(writer, "account", payment.Account);
         WriteElement(writer, "amount", payment.Amount);
         WriteElement(writer, "date", payment.Date);
         WriteElement(writer, "type", payment.GetTransactionType());
         writer.WriteEndElement();
     }
 }
Esempio n. 3
0
 public bool Equals(Payment other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other.amount == amount && Equals(other.account, account);
 }
 public void Generate(Payment payment)
 {
     CreateOutPutDirectoryIfDoesNotExist();
     CreateOutputXml(payment);
 }