protected SpecificationRunnerBase(
     IExpressionRunner runner,
     ISpecificationFinder finder,
     IConsoleFormatter formatter)
 {
     this.runner    = runner;
     this.finder    = finder;
     this.formatter = formatter;
 }
 protected SpecificationRunnerBase(
     IExpressionRunner runner,
     ISpecificationFinder finder,
     IConsoleFormatter formatter)
 {
     this.runner = runner;
     this.finder = finder;
     this.formatter = formatter;
 }
 public ISpecificationRunner CreateSpecificationRunner(bool parrallel, 
                                                       IExpressionRunner runner, 
                                                       ISpecificationFinder finder, 
                                                       IConsoleFormatter formatter)
 {
     if (parrallel) {
         return new ParallelSpecificationRunner(runner, finder, formatter);
     }
     
     return new DefaultSpecificationRunner(runner, finder, formatter);
 }
        public ISpecificationRunner CreateSpecificationRunner(bool parrallel,
                                                              IExpressionRunner runner,
                                                              ISpecificationFinder finder,
                                                              IConsoleFormatter formatter)
        {
            if (parrallel)
            {
                return(new ParallelSpecificationRunner(runner, finder, formatter));
            }

            return(new DefaultSpecificationRunner(runner, finder, formatter));
        }
        internal Interchange(ISpecificationFinder specFinder, DateTime date, int controlNumber, bool production, X12DelimiterSet delimiters)
            : base(null, delimiters, String.Format("ISA{1}00{1}          {1}00{1}          {1}01{1}SENDERID HERE  {1}01{1}RECIEVERID HERE{1}{3:yyMMdd}{1}{3:HHmm}{1}U{1}00401{1}{4:000000000}{1}1{1}{5}{1}{2}{0}",
                delimiters.SegmentTerminator, delimiters.ElementSeparator, delimiters.SubElementSeparator, date, controlNumber, production ? "P" : "T"))
        {
            _specFinder = specFinder;
            if (controlNumber > 999999999 || controlNumber < 1)
                throw new ElementValidationException("{0} Interchange Control Number must be a positive number between 1 and 999999999.", "ISA00", controlNumber.ToString());

            _functionGroups = new List<FunctionGroup>();

            SetTerminatingTrailerSegment(String.Format("IEA{0}0{0}{2:000000000}{1}", delimiters.ElementSeparator, delimiters.SegmentTerminator, controlNumber));
        }
Beispiel #6
0
        public Interchange(ISpecificationFinder specFinder, DateTime date, int controlNumber, bool production, X12DelimiterSet delimiters)
            : base(null, delimiters, String.Format("ISA{1}00{1}          {1}00{1}          {1}01{1}SENDERID HERE  {1}01{1}RECIEVERID HERE{1}{3:yyMMdd}{1}{3:HHmm}{1}U{1}00401{1}{4:000000000}{1}1{1}{5}{1}{2}{0}",
                                                   delimiters.SegmentTerminator, delimiters.ElementSeparator, delimiters.SubElementSeparator, date, controlNumber, production ? "P" : "T"))
        {
            _specFinder = specFinder;
            if (controlNumber > 999999999 || controlNumber < 1)
            {
                throw new ElementValidationException("{0} Interchange Control Number must be a positive number between 1 and 999999999.", "ISA00", controlNumber.ToString());
            }

            _functionGroups = new List <FunctionGroup>();

            SetTerminatingTrailerSegment(String.Format("IEA{0}0{0}{2:000000000}{1}", delimiters.ElementSeparator, delimiters.SegmentTerminator, controlNumber));
        }
 public SqlTransactionRepository(string dsn, ISpecificationFinder specFinder, string[] indexedSegments, string schema = "dbo", string commonSchema = "dbo", int segmentBatchSize = 1000, string sqlDateType = "date")
     : base(dsn, schema)
 {
     _commonDb      = new DbCreation <T>(dsn, commonSchema, sqlDateType);
     _transactionDb = new DbCreation <T>(dsn, schema, sqlDateType);
     _schemaEnsured = false;
     _batchSize     = segmentBatchSize;
     _segmentBatch  = new SegmentBatch <T>(this);
     _specs         = new Dictionary <string, SegmentSpecification>();
     foreach (var segmentId in indexedSegments)
     {
         var spec = specFinder.FindSegmentSpec("5010", segmentId.Trim());
         _specs.Add(segmentId.Trim(), spec);
     }
 }
 public SpecCommand(string[] args, 
                    IConsoleFormatterFactory formatterFactory,
                    ISpecificationReporter reporter,
                    IFileSystem fileSystem,
                    IConsoleWritterFactory consoleFactory,
                    IExpressionRunnerFactory expressionFactory,
                    ISpecificationFinder finder,
                    ISpecificationRunnerFactory runnerFactory)
 {
     this.args = args;
     this.formatterFactory = formatterFactory;
     this.reporter = reporter;
     this.fileSystem = fileSystem;
     this.consoleFactory = consoleFactory;
     this.expressionFactory = expressionFactory;
     this.finder = finder;
     this.runnerFactory = runnerFactory;
 }
 public SpecCommand(string[] args,
                    IConsoleFormatterFactory formatterFactory,
                    ISpecificationReporter reporter,
                    IFileSystem fileSystem,
                    IConsoleWritterFactory consoleFactory,
                    IExpressionRunnerFactory expressionFactory,
                    ISpecificationFinder finder,
                    ISpecificationRunnerFactory runnerFactory)
 {
     this.args              = args;
     this.formatterFactory  = formatterFactory;
     this.reporter          = reporter;
     this.fileSystem        = fileSystem;
     this.consoleFactory    = consoleFactory;
     this.expressionFactory = expressionFactory;
     this.finder            = finder;
     this.runnerFactory     = runnerFactory;
 }
Beispiel #10
0
        public Interchange(ISpecificationFinder specFinder, DateTime date, int controlNumber, bool production, X12DelimiterSet delimiters)
            : base(null, delimiters, string.Format(
                       "ISA{1}00{1}          {1}00{1}          {1}01{1}SENDERID HERE  {1}01{1}RECIEVERID HERE{1}{3:yyMMdd}{1}{3:HHmm}{1}U{1}00401{1}{4:000000000}{1}1{1}{5}{1}{2}{0}",
                       delimiters.SegmentTerminator,
                       delimiters.ElementSeparator,
                       delimiters.SubElementSeparator,
                       date,
                       controlNumber,
                       production ? "P" : "T"))
        {
            this.SpecFinder = specFinder;
            if (controlNumber > 999999999 || controlNumber < 1)
            {
                throw new ElementValidationException(
                          Resources.InterchangeValueOutOfRange,
                          "ISA00",
                          controlNumber.ToString());
            }

            this.functionGroups = new List <FunctionGroup>();
            this.SetTerminatingTrailerSegment(string.Format("IEA{0}0{0}{2:000000000}{1}", delimiters.ElementSeparator, delimiters.SegmentTerminator, controlNumber));
        }
Beispiel #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SqlTransactionRepository"/> class
 /// </summary>
 /// <param name="dsn">Data source information</param>
 /// <param name="specFinder">Specification finder for data structure information</param>
 /// <param name="indexedSegments">Segments stored in database</param>
 /// <param name="identityType">Identity type</param>
 /// <param name="schema">Database schema for data access</param>
 /// <param name="commonSchema">Common database schema</param>
 /// <param name="segmentBatchSize">Number of segments to pull from database at a time</param>
 /// <param name="sqlDateType">"Date" type used by database</param>
 public SqlTransactionRepository(
     string dsn,
     ISpecificationFinder specFinder,
     string[] indexedSegments,
     Type identityType,
     string schema        = "dbo",
     string commonSchema  = "dbo",
     int segmentBatchSize = 1000,
     string sqlDateType   = "date")
     : base(dsn, identityType, schema)
 {
     this.CommonDb      = new DbCreation(dsn, commonSchema, identityType, sqlDateType);
     this.TransactionDb = new DbCreation(dsn, schema, identityType, sqlDateType);
     this.idProvider    = this.GetIdProvider(dsn, commonSchema, identityType, segmentBatchSize / 10);
     this.schemaEnsured = false;
     this.batchSize     = segmentBatchSize;
     this.SegmentBatch  = new SegmentBatch(this, identityType);
     this.specs         = new Dictionary <string, SegmentSpecification>();
     foreach (var segmentId in indexedSegments)
     {
         var spec = specFinder.FindSegmentSpec("5010", segmentId.Trim());
         this.specs.Add(segmentId.Trim(), spec);
     }
 }
Beispiel #12
0
 public X12EdiParsingService(bool suppressComments, ISpecificationFinder specFinder)
 {
     _parser = new X12Parser(specFinder);
 }
Beispiel #13
0
 public X12Parser(ISpecificationFinder specFinder)
 {
     _specFinder = specFinder;
 }
Beispiel #14
0
 public X12EdiParsingService(bool suppressComments, ISpecificationFinder specFinder) : this(suppressComments, new X12Parser(specFinder, true))
 {
 }
Beispiel #15
0
 internal Interchange(ISpecificationFinder specFinder, string segmentString)
     : base(null, new X12DelimiterSet(segmentString.ToCharArray()), segmentString)
 {
     _specFinder = specFinder;
     _functionGroups = new List<FunctionGroup>();
 }
Beispiel #16
0
 public void BeforeEach()
 {
     fileSystem = Substitute.For <IFileSystem>();
     finder     = new DefaultSpecificationFinder(fileSystem);
 }
 public X12Parser(ISpecificationFinder specFinder)
 {
     _specFinder = specFinder;
 }
 public X12AcknowledgmentService(ISpecificationFinder specFinder)
 {
     _specFinder = specFinder;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="X12Parser"/> class
 /// </summary>
 /// <param name="specFinder">Specification finder for determining how to process X12</param>
 public X12Parser(ISpecificationFinder specFinder)
     : this(specFinder, true, new char[] { })
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="X12Parser"/> class
 /// </summary>
 /// <param name="specFinder">Specification finder for determining how to process X12</param>
 /// <param name="throwExceptionOnSyntaxErrors">Flag if exceptions should be thrown with invalid syntax</param>
 public X12Parser(ISpecificationFinder specFinder, bool throwExceptionOnSyntaxErrors)
     : this(specFinder, throwExceptionOnSyntaxErrors, new char[] { })
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="X12Parser"/> class
 /// </summary>
 /// <param name="specFinder">Specification finder for determining how to process X12</param>
 /// <param name="throwExceptionOnSyntaxErrors">Flag if exceptions should be thrown with invalid syntax</param>
 /// <param name="ignoredChars">Characters to be ignored by the parser</param>
 public X12Parser(ISpecificationFinder specFinder, bool throwExceptionOnSyntaxErrors, char[] ignoredChars)
 {
     this.specFinder = specFinder;
     this.throwExceptionOnSyntaxErrors = throwExceptionOnSyntaxErrors;
     this.ignoredChars = ignoredChars;
 }
 public ParallelSpecificationRunner(IExpressionRunner runner,
                                    ISpecificationFinder finder,
                                    IConsoleFormatter formatter) : base(runner, finder, formatter)
 {
 }
Beispiel #23
0
 internal FunctionGroup(ISpecificationFinder specFinder, Container parent, X12DelimiterSet delimiters, string segment)
     : base(parent, delimiters, segment)
 {
     _specFinder   = specFinder;
     _transactions = new List <Transaction>();
 }
Beispiel #24
0
 internal Interchange(ISpecificationFinder specFinder, string segmentString)
     : base(null, new X12DelimiterSet(segmentString.ToCharArray()), segmentString)
 {
     _specFinder     = specFinder;
     _functionGroups = new List <FunctionGroup>();
 }
 public X12AcknowledgmentService(ISpecificationFinder specFinder) : this(specFinder, new char[] { })
 {
 }
 public X12EdiParsingService(bool suppressComments, ISpecificationFinder specFinder)
 {
     _parser = new X12Parser(specFinder);
 }
 public void BeforeEach()
 {
     fileSystem = Substitute.For<IFileSystem>();
     finder = new DefaultSpecificationFinder(fileSystem);
 }
 internal FunctionGroup(ISpecificationFinder specFinder, Container parent, X12DelimiterSet delimiters, string segment)
     : base(parent, delimiters, segment)
 {
     _specFinder = specFinder;
     _transactions = new List<Transaction>();
 }
 public SqlGuidTransactionRepository(string dsn, ISpecificationFinder specFinder, string[] indexedSegments, string schema = "dbo", string commonSchema = "dbo", int segmentBatchSize = 1000)
     : base(dsn, specFinder, indexedSegments, schema, commonSchema, segmentBatchSize)
 {
 }
 public X12AcknowledgmentService(ISpecificationFinder specFinder, char[] ignoredChars)
 {
     _specFinder   = specFinder;
     _ignoredChars = ignoredChars;
 }
 public ParallelSpecificationRunner(IExpressionRunner runner, 
                                    ISpecificationFinder finder, 
                                    IConsoleFormatter formatter) : base(runner, finder, formatter)
 {
 }