Exemplo n.º 1
0
 protected override void ComposeFixtureInstances()
 {
     base.ComposeFixtureInstances();
     grouper      = new Infrastructure.Grouper.Grouper();
     inputRecord  = new GrouperInputRecord();
     outputRecord = new GrouperOutputRecord();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the grouper output records.
        /// </summary>
        /// <returns></returns>
        public IEnumerable <GrouperOutputRecord> GetGrouperOutputRecords()
        {
            if (_uploadFileIsOpen)
            {
                while (_uploadFile.Peek() >= 0)
                {
                    var record = new GrouperOutputRecord();

                    string uploadLine = _uploadFile.ReadLine();
                    if (uploadLine == null)
                    {
                        // We've reached the end of the file so try to close and dispose of it.
                        CloseUploadFile();
                        yield break;
                    }

                    // We have a good record, so try to deserialize it.
                    // TODO: error check the deserialize process
                    record.OutputRecord = uploadLine;

                    if (record.OutputRecordValid)
                    {
                        yield return(record);
                    }
                }
            }
        }
Exemplo n.º 3
0
 protected override void ComposeFixtureInstances()
 {
     base.ComposeFixtureInstances();
     grouper      = new Infrastructure.Grouper.Grouper();
     inputRecord  = new GrouperInputRecord();
     outputRecord = new GrouperOutputRecord();
     grouper.AddRecordToBeGrouped(inputRecord);
     grouper.RunGrouper();
     grouper.GetGroupedRecord(outputRecord);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Gets the grouped record.
 /// </summary>
 /// <param name="record">The record.</param>
 /// <returns></returns>
 public bool GetGroupedRecord(GrouperOutputRecord record)
 {
     if (_uploadFileIsOpen)
     {
         string uploadLine = _uploadFile.ReadLine();
         if (uploadLine == null)
         {
             // We've reached the end of the file so try to close and dispose of it.
             CloseUploadFile();
         }
         else
         {
             // We have a good record, so try to deserialize it.
             // TODO: error check the deserialize process
             record.OutputRecord = uploadLine;
             return(true);
         }
     }
     return(false);
 }