Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="MerchantProcessor" /> class.
        /// </summary>
        /// <param name="transaction">The transaction.</param>
        protected MerchantProcessor(IMerchantTransaction transaction)
        {
            SharedTransactionScope = transaction;

            Solvers = new List <ISolverBase <IMerchantTransaction> >()
            {
                new RomanSolver(SharedTransactionScope),
                new UnitSolver(SharedTransactionScope)
            };

            Parsers = new List <IParserEngine <IMerchantTransaction> >()
            {
                new RomanBaseParser(SharedTransactionScope),
                new UnitParser(SharedTransactionScope),
                new EnquiryParser(SharedTransactionScope)
            };

            Solvers.ToList().ForEach(p => p.OnSolveCompleted += (s, a) => OnTransactionProcessed?.Invoke(s, a));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UnitSolver"/> class.
 /// </summary>
 /// <param name="transaction">The transaction.</param>
 public UnitSolver(IMerchantTransaction transaction)
 {
     Transaction = transaction as MerchantTransaction;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EnquiryParser"/> class.
 /// </summary>
 /// <param name="transaction">The transaction.</param>
 public EnquiryParser(IMerchantTransaction transaction)
 {
     Transaction = transaction as MerchantTransaction;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RomanSolver"/> class.
 /// </summary>
 /// <param name="transaction">The transaction.</param>
 public RomanSolver(IMerchantTransaction transaction)
 {
     Transaction = transaction as MerchantTransaction;
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="RomanBaseParser" /> class.
 /// </summary>
 /// <param name="transaction">The transaction.</param>
 public RomanBaseParser(IMerchantTransaction transaction)
 {
     Transaction = transaction as MerchantTransaction;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UnitParser"/> class.
 /// </summary>
 /// <param name="transaction">The transaction.</param>
 public UnitParser(IMerchantTransaction transaction)
 {
     Transaction = transaction as MerchantTransaction;
 }