public void Process_Given_an_data_row_with_warning_Should_indicate_warning()
        {
            var fileDataSource = CreateFileDataSource("balance-with-invalid-date-in-a-data-row.10.csv");

            var path = Path.Combine(_testDirectory, "TestFiles", "balance-with-header-and-trailer-with-warnings.definition.10.xml");
            var inputDefinitionFile = FileLoader.Load <InputDefinitionFile10>(path);
            var fileProcessorDefinitionWithWarnings = ProcessorDefinition.FileProcessorDefinitionBuilder.CreateFileProcessorDefinition(inputDefinitionFile);

            var target = new ParsedDataProcessor10(fileDataSource, fileProcessorDefinitionWithWarnings);

            var actual = target.Process();

            TestContext.PrintJson(actual);


            Assert.AreEqual(ValidationResultType.Warning, actual.ValidationResult);
            Assert.AreEqual(0, actual.Errors.Count);
            Assert.AreEqual(3, actual.DataRows.Count);
            Assert.AreEqual(0, actual.InvalidDataRows.Count);

            var rowWithWarning = actual.DataRows[1];

            Assert.AreEqual(ValidationResultType.Warning, rowWithWarning.ValidationResult);
            Assert.AreEqual(0, rowWithWarning.Errors.Count);
            Assert.AreEqual(1, rowWithWarning.Warnings.Count);
            Assert.AreEqual("Invalid DOB '1022200a'", rowWithWarning.Warnings[0]);
        }
Exemplo n.º 2
0
        public void Process_Given_a_decoder_with_critical_validation_result_Should_abort_the_process()
        {
            var fileDataSourceValidFile = TestHelpers.CreateFileDataSource <ParserContext10>("balance-with-invalid-header.10.csv", false);

            var path = Path.Combine(_testDirectory, "TestFiles", "balance-with-header-and-trailer-with-critical-decoder.definition.10.xml");
            var inputDefinitionFile = FileLoader.Load <InputDefinitionFile10>(path);
            var fileProcessorDefinitionWithCritical = ProcessorDefinition.FileProcessorDefinitionBuilder.CreateFileProcessorDefinition(inputDefinitionFile);

            var target = new ParsedDataProcessor10(fileDataSourceValidFile, fileProcessorDefinitionWithCritical);

            var actual = target.Process();

            TestContext.PrintJson(actual);

            Assert.AreEqual(ValidationResultType.Critical, actual.ValidationResult);
            Assert.AreEqual(1, actual.Errors.Count);
            Assert.AreEqual(0, actual.DataRows.Count);
            Assert.AreEqual(0, actual.InvalidDataRows.Count);

            Assert.AreEqual("Header row is invalid", actual.Errors[0]);

            Assert.IsNotNull(actual.Header);
            Assert.AreEqual(ValidationResultType.Critical, actual.Header.ValidationResult);
            Assert.AreEqual(1, actual.Header.Errors.Count);
            Assert.AreEqual("Invalid Record Type (Header Row) 'H'", actual.Header.Errors[0]);
            Assert.AreEqual(0, actual.Header.Warnings.Count);

            Assert.IsNull(actual.Trailer);
        }
Exemplo n.º 3
0
        public void Process_Given_a_file_with_a_missing_header_Should_indicate_the_error()
        {
            var fileDataSourceValidFile = TestHelpers.CreateFileDataSource <ParserContext10>("balance-missing-header.10.csv", false);
            var target = new ParsedDataProcessor10(fileDataSourceValidFile, _fileProcessorDefinition);

            var actual = target.Process();

            TestContext.PrintJson(actual);

            Assert.AreEqual(ValidationResultType.Error, actual.ValidationResult);
            Assert.AreEqual(2, actual.DataRows.Count);
            Assert.AreEqual(0, actual.InvalidDataRows.Count);

            Assert.AreEqual(2, actual.Errors.Count);
            Assert.AreEqual("Header row is invalid", actual.Errors[0]);
            Assert.AreEqual("Trailer row is invalid", actual.Errors[1]);

            Assert.IsNotNull(actual.Header);
            Assert.AreEqual(ValidationResultType.Error, actual.Header.ValidationResult);
            Assert.AreEqual(1, actual.Header.Errors.Count);
            Assert.AreEqual("Header Row - The expected number of fields 4 is not equal to the actual number of fields 8", actual.Header.Errors[0]);
            Assert.AreEqual(0, actual.Header.Warnings.Count);

            Assert.IsNotNull(actual.Trailer);
            Assert.AreEqual(ValidationResultType.Error, actual.Trailer.ValidationResult);
            Assert.AreEqual(1, actual.Trailer.Errors.Count);
            Assert.AreEqual("Record Count should match the number data row", actual.Trailer.Errors[0]);
        }
Exemplo n.º 4
0
        public ParsedDataAndSpec10 LoadVersion10(string content, string fileSpecXml)
        {
            var inputDefinitionFile     = FileLoader.LoadFromXml <InputDefinitionFile10>(fileSpecXml);
            var fileProcessorDefinition = DataProcessor.ProcessorDefinition.FileProcessorDefinitionBuilder.CreateFileProcessorDefinition(inputDefinitionFile);

            var result = new ParsedDataAndSpec10 {
                InputDefinitionFile = inputDefinitionFile
            };

            var config = new StreamDataSourceConfig
            {
                Delimiter = inputDefinitionFile.Delimiter,
                HasFieldsEnclosedInQuotes = inputDefinitionFile.HasFieldsEnclosedInQuotes,
                CommentedOutIndicator     = inputDefinitionFile.CommentedOutIndicator
            };

            using (var stream = new MemoryStream())
            {
                using (var writer = new StreamWriter(stream))
                {
                    writer.Write(content);
                    writer.Flush();
                    stream.Seek(0, SeekOrigin.Begin);

                    var source    = new StreamDataSource <ParserContext10>(config, stream);
                    var processor = new ParsedDataProcessor10(source, fileProcessorDefinition);
                    result.ParsedData = processor.Process();
                }
            }

            return(result);
        }
        public void Process_Given_multiple_rows_with_errors_Should_indicate_the_errors()
        {
            var fileDataSource = CreateFileDataSource("balance-with-multiple-errors.10.csv");
            var target         = new ParsedDataProcessor10(fileDataSource, _fileProcessorDefinition);

            var actual = target.Process();

            TestContext.PrintJson(actual.Errors);
            TestContext.PrintJson(actual.DataRows);

            Assert.AreEqual(ValidationResultType.Error, actual.ValidationResult);
            Assert.AreEqual(2, actual.Errors.Count);
            Assert.AreEqual(3, actual.DataRows.Count);
            Assert.AreEqual(2, actual.InvalidDataRows.Count);

            Assert.AreEqual("Header row is invalid", actual.Errors[0]);
            Assert.AreEqual("There are 2 invalid data rows", actual.Errors[1]);

            Assert.AreEqual(ValidationResultType.Error, actual.Header.ValidationResult);
            Assert.AreEqual(1, actual.Header.Errors.Count);
            Assert.AreEqual(0, actual.Header.Warnings.Count);
            Assert.AreEqual("Invalid Record Type (Header Row) 'H'", actual.Header.Errors[0]);

            Assert.AreSame(actual.DataRows[1], actual.InvalidDataRows[0]);
            var invalidRow = actual.DataRows[1];

            Assert.AreEqual(ValidationResultType.Error, invalidRow.ValidationResult);
            Assert.AreEqual(1, invalidRow.Errors.Count);
            Assert.AreEqual(0, invalidRow.Warnings.Count);
            Assert.AreEqual("Invalid DOB '1022200a'", invalidRow.Errors[0]);
        }
        public void Process_Given_a_rule_violation_Result_should_indicate_error_and_warning()
        {
            var fileDataSourceValidFile = TestHelpers.CreateFileDataSource <ParserContext10>("balance-with-rule-violations.10.csv", false);
            var target = new ParsedDataProcessor10(fileDataSourceValidFile, _fileProcessorDefinition);

            var actual = target.Process();

            TestContext.PrintJson(actual);

            Assert.AreEqual(ValidationResultType.Error, actual.ValidationResult);
            Assert.AreEqual(2, actual.Errors.Count);
            Assert.AreEqual(3, actual.DataRows.Count);
            Assert.AreEqual(0, actual.InvalidDataRows.Count);

            Assert.AreEqual("Header row is invalid", actual.Errors[0]);
            Assert.AreEqual("Trailer row is invalid", actual.Errors[1]);

            Assert.AreEqual(ValidationResultType.Error, actual.Header.ValidationResult);
            Assert.AreEqual(ValidationResultType.Error, actual.Header.Fields[3].ValidationResult);
            Assert.AreEqual(1, actual.Header.Errors.Count);
            Assert.AreEqual("Sequence number should be equal or less than 100", actual.Header.Errors[0]);
            Assert.AreEqual(1, actual.Header.Warnings.Count);
            Assert.AreEqual("Sequence number should be between 1 and 100", actual.Header.Warnings[0]);

            Assert.AreEqual(ValidationResultType.Error, actual.Trailer.ValidationResult);
            Assert.AreEqual(ValidationResultType.Warning, actual.Trailer.Fields[1].ValidationResult);
            Assert.AreEqual(ValidationResultType.Error, actual.Trailer.Fields[2].ValidationResult);
            Assert.AreEqual(1, actual.Trailer.Errors.Count);
            Assert.AreEqual("Record Count should match the number data row", actual.Trailer.Errors[0]);
            Assert.AreEqual(1, actual.Trailer.Warnings.Count);
            Assert.AreEqual("Balance Total is incorrect", actual.Trailer.Warnings[0]);
        }
        public void Process_Given_a_valid_file_Header_should_be_decoded()
        {
            var fileDataSourceValidFile = CreateFileDataSource("balance-with-header-and-trailer.10.csv");
            var target = new ParsedDataProcessor10(fileDataSourceValidFile, _fileProcessorDefinition);

            var actual = target.Process();

            TestContext.PrintJson(actual.DataRows);
            TestContext.PrintRowJsons(actual.DataRows);

            Assert.IsNotNull(actual.Header);
            Assert.AreEqual(0, actual.Header.Index);
            Assert.AreEqual(ValidationResultType.Valid, actual.Header.ValidationResult);
            Assert.AreEqual("HEADER,09212013,ABCDCompLndn,0001", actual.Header.Raw);
            Assert.AreEqual("HEADER,09212013,ABCDCompLndn,0001", string.Join(',', actual.Header.RawFields));
            Assert.AreEqual(0, actual.Header.Errors.Count);
            Assert.AreEqual(0, actual.Header.Warnings.Count);
            Assert.AreEqual("{\"RecordType\":\"HEADER\",\"CreationDate\":\"2013-09-21T00:00:00\",\"LocationID\":\"ABCDCompLndn\",\"SequenceNumber\":1}", actual.Header.Json);

            Assert.AreEqual(4, actual.Header.Fields.Count);
            AssertValidField(0, "HEADER", "HEADER", actual.Header, actual.Header.Fields[0]);
            AssertValidField(1, "09212013", new DateTime(2013, 9, 21), actual.Header, actual.Header.Fields[1]);
            AssertValidField(2, "ABCDCompLndn", "ABCDCompLndn", actual.Header, actual.Header.Fields[2]);
            AssertValidField(3, "0001", 1, actual.Header, actual.Header.Fields[3]);
        }
        public void Process_Given_an_invalid_data_row_Should_indicate_error()
        {
            var fileDataSource = CreateFileDataSource("balance-with-invalid-date-in-a-data-row.10.csv");
            var target         = new ParsedDataProcessor10(fileDataSource, _fileProcessorDefinition);

            var actual = target.Process();

            TestContext.PrintJson(actual.Errors);
            TestContext.PrintJson(actual.DataRows);

            Assert.AreEqual(ValidationResultType.Error, actual.ValidationResult);
            Assert.AreEqual(1, actual.Errors.Count);
            Assert.AreEqual(3, actual.DataRows.Count);
            Assert.AreEqual(1, actual.InvalidDataRows.Count);

            Assert.AreEqual("There is 1 invalid data row", actual.Errors[0]);

            Assert.AreSame(actual.DataRows[1], actual.InvalidDataRows[0]);

            var invalidRow = actual.DataRows[1];

            Assert.AreEqual(ValidationResultType.Error, invalidRow.ValidationResult);
            Assert.AreEqual(1, invalidRow.Errors.Count);
            Assert.AreEqual(0, invalidRow.Warnings.Count);
            Assert.AreEqual("Invalid DOB '1022200a'", invalidRow.Errors[0]);
        }
        public void Process_Given_a_file_with_header_data_and_trailer_Should_create_the_json_for_the_rows()
        {
            _fileProcessorDefinition.CreateRowJsonEnabled = true;
            var target = new ParsedDataProcessor10(_fileDataSource, _fileProcessorDefinition);

            var actual = target.Process();

            TestContext.PrintJson(actual.DataRows);
            TestContext.PrintRowJsons(actual.DataRows);

            Assert.AreEqual(2, actual.DataRows.Count);
            Assert.AreEqual(0, actual.InvalidDataRows.Count);
            Assert.AreEqual(0, actual.Errors.Count);

            Assert.AreEqual("{\"Field-HA\":\"field-1a\",\"Field-HB\":\"field-1b\"}", actual.Header.Json);

            var dataRow0 = actual.DataRows[0];

            Assert.AreEqual("{\"Field-DA\":\"field-2a\",\"Field-DB\":\"field-2b\",\"Field-DC\":\"field-2c\"}", dataRow0.Json);

            var dataRow1 = actual.DataRows[1];

            Assert.AreEqual("{\"Field-DA\":\"field-3a\",\"Field-DB\":\"field-3b\",\"Field-DC\":\"field-3c\"}", dataRow1.Json);

            Assert.AreEqual("{\"Field-TA\":\"field-4a\",\"Field-TB\":\"field-4b\"}", actual.Trailer.Json);
        }
        public void Process_Given_a_file_without_header_and_trailer_Should_decode_and_parse_fields()
        {
            var target = new ParsedDataProcessor10(_fileDataSource, _fileProcessorDefinition);

            var actual = target.Process();

            Assert.AreEqual(3, actual.DataRows.Count);
            Assert.AreEqual(0, actual.InvalidDataRows.Count);
            Assert.AreEqual(0, actual.Errors.Count);

            var row0 = actual.DataRows[0];

            Assert.AreEqual(3, row0.Fields.Count);
            Assert.AreEqual("field-1a", row0.Fields[0].Value);
            Assert.AreEqual("field-1b", row0.Fields[1].Value);
            Assert.AreEqual("field-1c", row0.Fields[2].Value);

            var row1 = actual.DataRows[1];

            Assert.AreEqual(3, row1.Fields.Count);
            Assert.AreEqual("field-2a", row1.Fields[0].Value);
            Assert.AreEqual("field-2b", row1.Fields[1].Value);
            Assert.AreEqual("field-2c", row1.Fields[2].Value);

            var row2 = actual.DataRows[2];

            Assert.AreEqual(3, row2.Fields.Count);
            Assert.AreEqual("field-3a", row2.Fields[0].Value);
            Assert.AreEqual("field-3b", row2.Fields[1].Value);
            Assert.AreEqual("field-3c", row2.Fields[2].Value);

            Assert.IsNull(actual.Header);
            Assert.IsNull(actual.Trailer);
        }
        public void Process_Given_a_valid_file_There_should_no_be_errors()
        {
            var fileDataSourceValidFile = CreateFileDataSource("balance-with-header-and-trailer.10.csv");
            var target = new ParsedDataProcessor10(fileDataSourceValidFile, _fileProcessorDefinition);

            var actual = target.Process();

            TestContext.PrintJson(actual.DataRows);

            Assert.AreEqual(ValidationResultType.Valid, actual.ValidationResult);
            Assert.AreEqual(0, actual.Errors.Count);
            Assert.AreEqual(3, actual.DataRows.Count);
            Assert.AreEqual(0, actual.InvalidDataRows.Count);
        }
        public void Process_Given_an_invalid_trailer_Should_indicate_error()
        {
            var fileDataSource = CreateFileDataSource("balance-with-invalid-trailer.10.csv");
            var target         = new ParsedDataProcessor10(fileDataSource, _fileProcessorDefinition);

            var actual = target.Process();

            TestContext.PrintJson(actual.Errors);
            TestContext.PrintJson(actual.DataRows);

            Assert.AreEqual(ValidationResultType.Error, actual.ValidationResult);
            Assert.AreEqual(1, actual.Errors.Count);
            Assert.AreEqual(3, actual.DataRows.Count);
            Assert.AreEqual(0, actual.InvalidDataRows.Count);

            Assert.AreEqual("Trailer row is invalid", actual.Errors[0]);

            Assert.AreEqual(ValidationResultType.Error, actual.Trailer.ValidationResult);
            Assert.AreEqual(1, actual.Trailer.Errors.Count);
            Assert.AreEqual(0, actual.Trailer.Warnings.Count);
            Assert.AreEqual("Invalid Balance Total '6000.oo'", actual.Trailer.Errors[0]);
        }
        public void Process_Given_a_file_with_header_data_and_trailer_Should_decode_and_parse_fields()
        {
            var target = new ParsedDataProcessor10(_fileDataSource, _fileProcessorDefinition);

            var actual = target.Process();

            TestContext.PrintJson(actual.DataRows);

            Assert.AreEqual(2, actual.DataRows.Count);
            Assert.AreEqual(0, actual.InvalidDataRows.Count);
            Assert.AreEqual(0, actual.Errors.Count);

            Assert.IsNull(actual.Header.Json);
            Assert.AreEqual(2, actual.Header.Fields.Count);
            Assert.AreEqual("field-1a", actual.Header.Fields[0].Value);
            Assert.AreEqual("field-1b", actual.Header.Fields[1].Value);

            var dataRow0 = actual.DataRows[0];

            Assert.IsNull(dataRow0.Json);
            Assert.AreEqual(3, dataRow0.Fields.Count);
            Assert.AreEqual("field-2a", dataRow0.Fields[0].Value);
            Assert.AreEqual("field-2b", dataRow0.Fields[1].Value);
            Assert.AreEqual("field-2c", dataRow0.Fields[2].Value);

            var dataRow1 = actual.DataRows[1];

            Assert.IsNull(dataRow1.Json);
            Assert.AreEqual(3, dataRow1.Fields.Count);
            Assert.AreEqual("field-3a", dataRow1.Fields[0].Value);
            Assert.AreEqual("field-3b", dataRow1.Fields[1].Value);
            Assert.AreEqual("field-3c", dataRow1.Fields[2].Value);

            Assert.IsNull(actual.Trailer.Json);
            Assert.AreEqual(2, actual.Trailer.Fields.Count);
            Assert.AreEqual("field-4a", actual.Trailer.Fields[0].Value);
            Assert.AreEqual("field-4b", actual.Trailer.Fields[1].Value);
        }
        public void Process_Given_a_valid_file_Trailer_should_be_decoded()
        {
            var fileDataSourceValidFile = CreateFileDataSource("balance-with-header-and-trailer.10.csv");
            var target = new ParsedDataProcessor10(fileDataSourceValidFile, _fileProcessorDefinition);

            var actual = target.Process();

            TestContext.PrintJson(actual.DataRows);

            Assert.IsNotNull(actual.Trailer);
            Assert.AreEqual(4, actual.Trailer.Index);
            Assert.AreEqual(ValidationResultType.Valid, actual.Trailer.ValidationResult);
            Assert.AreEqual("TRAILER,6000.00,3", actual.Trailer.Raw);
            Assert.AreEqual("TRAILER,6000.00,3", string.Join(',', actual.Trailer.RawFields));
            Assert.AreEqual(0, actual.Trailer.Errors.Count);
            Assert.AreEqual(0, actual.Trailer.Warnings.Count);
            Assert.AreEqual("{\"RecordType\":\"TRAILER\",\"BalanceTotal\":6000.00,\"RecordCount\":3}", actual.Trailer.Json);

            Assert.AreEqual(3, actual.Trailer.Fields.Count);
            AssertValidField(0, "TRAILER", "TRAILER", actual.Trailer, actual.Trailer.Fields[0]);
            AssertValidField(1, "6000.00", 6000m, actual.Trailer, actual.Trailer.Fields[1]);
            AssertValidField(2, "3", 3, actual.Trailer, actual.Trailer.Fields[2]);
        }
        public void Process_Given_an_invalid_header_Should_indicate_error()
        {
            var fileDataSource = CreateFileDataSource("balance-with-invalid-header.10.csv");
            var target         = new ParsedDataProcessor10(fileDataSource, _fileProcessorDefinition);

            var actual = target.Process();

            TestContext.PrintJson(actual.Errors);
            TestContext.PrintJson(actual.DataRows);

            Assert.AreEqual(ValidationResultType.Error, actual.ValidationResult);
            Assert.AreEqual(1, actual.Errors.Count);
            Assert.AreEqual(3, actual.DataRows.Count);
            Assert.AreEqual(0, actual.InvalidDataRows.Count);

            Assert.AreEqual("Header row is invalid", actual.Errors[0]);

            var invalidRow = actual.Header;

            Assert.AreEqual(ValidationResultType.Error, invalidRow.ValidationResult);
            Assert.AreEqual(1, invalidRow.Errors.Count);
            Assert.AreEqual(0, invalidRow.Warnings.Count);
            Assert.AreEqual("Invalid Record Type (Header Row) 'H'", invalidRow.Errors[0]);
        }
        public void Process_Given_that_the_number_of_fields_dont_match_The_row_should_indicate_the_error()
        {
            _fileProcessorDefinition.DataRowProcessorDefinition.FieldProcessorDefinitions = new FieldProcessorDefinition[]
            {
                new FieldProcessorDefinition {
                    Decoder = _textDecoder, FieldName = "FieldA"
                },
                new FieldProcessorDefinition {
                    Decoder = _textDecoder, FieldName = "FieldB"
                }
            };

            var target = new ParsedDataProcessor10(_fileDataSource, _fileProcessorDefinition);

            var actual = target.Process();

            Assert.AreEqual(3, actual.DataRows.Count);
            Assert.AreEqual(3, actual.InvalidDataRows.Count);

            var row0 = actual.DataRows[0];

            Assert.AreEqual(1, row0.Errors.Count);
            Assert.AreEqual("Data Row - The expected number of fields 2 is not equal to the actual number of fields 3", row0.Errors[0]);
        }
        public void Process_Given_a_valid_file_Data_rows_should_be_decoded()
        {
            var fileDataSourceValidFile = CreateFileDataSource("balance-with-header-and-trailer.10.csv");
            var target = new ParsedDataProcessor10(fileDataSourceValidFile, _fileProcessorDefinition);

            var actual = target.Process();

            TestContext.PrintJson(actual.DataRows);

            var dataRow0 = actual.DataRows[0];

            Assert.AreEqual(1, dataRow0.Index);
            Assert.AreEqual(ValidationResultType.Valid, dataRow0.ValidationResult);
            Assert.AreEqual("BALANCE,1001,111-22-1001,fname-01,lname-01,10212000,1000.00,AA", dataRow0.Raw);
            Assert.AreEqual("BALANCE,1001,111-22-1001,fname-01,lname-01,10212000,1000.00,AA", string.Join(',', dataRow0.RawFields));
            Assert.AreEqual(0, dataRow0.Errors.Count);
            Assert.AreEqual(0, dataRow0.Warnings.Count);
            Assert.AreEqual("{\"RecordType\":\"BALANCE\",\"ConsumerID\":1001,\"SSN\":\"111-22-1001\",\"FirstName\":\"fname-01\",\"LastName\":\"lname-01\",\"DOB\":\"2000-10-21T00:00:00\",\"Balance\":1000.00,\"CustomField\":\"AA\"}", dataRow0.Json);

            Assert.AreEqual(8, dataRow0.Fields.Count);
            AssertValidField(0, "BALANCE", "BALANCE", dataRow0, dataRow0.Fields[0]);
            AssertValidField(1, "1001", 1001, dataRow0, dataRow0.Fields[1]);
            AssertValidField(2, "111-22-1001", "111-22-1001", dataRow0, dataRow0.Fields[2]);
            AssertValidField(3, "fname-01", "fname-01", dataRow0, dataRow0.Fields[3]);
            AssertValidField(4, "lname-01", "lname-01", dataRow0, dataRow0.Fields[4]);
            AssertValidField(5, "10212000", new DateTime(2000, 10, 21), dataRow0, dataRow0.Fields[5]);
            AssertValidField(6, "1000.00", 1000m, dataRow0, dataRow0.Fields[6]);
            AssertValidField(7, "AA", "AA", dataRow0, dataRow0.Fields[7]);

            var dataRow1 = actual.DataRows[1];

            Assert.AreEqual(2, dataRow1.Index);
            Assert.AreEqual(ValidationResultType.Valid, dataRow1.ValidationResult);
            Assert.AreEqual("BALANCE,1002,111-22-1002,fname-02,lname-02,10222000,2000.00,", dataRow1.Raw);
            Assert.AreEqual("BALANCE,1002,111-22-1002,fname-02,lname-02,10222000,2000.00,", string.Join(',', dataRow1.RawFields));
            Assert.AreEqual(0, dataRow1.Errors.Count);
            Assert.AreEqual(0, dataRow1.Warnings.Count);
            Assert.AreEqual("{\"RecordType\":\"BALANCE\",\"ConsumerID\":1002,\"SSN\":\"111-22-1002\",\"FirstName\":\"fname-02\",\"LastName\":\"lname-02\",\"DOB\":\"2000-10-22T00:00:00\",\"Balance\":2000.00,\"CustomField\":\"\"}", dataRow1.Json);

            Assert.AreEqual(8, dataRow1.Fields.Count);
            AssertValidField(0, "BALANCE", "BALANCE", dataRow1, dataRow1.Fields[0]);
            AssertValidField(1, "1002", 1002, dataRow1, dataRow1.Fields[1]);
            AssertValidField(2, "111-22-1002", "111-22-1002", dataRow1, dataRow1.Fields[2]);
            AssertValidField(3, "fname-02", "fname-02", dataRow1, dataRow1.Fields[3]);
            AssertValidField(4, "lname-02", "lname-02", dataRow1, dataRow1.Fields[4]);
            AssertValidField(5, "10222000", new DateTime(2000, 10, 22), dataRow1, dataRow1.Fields[5]);
            AssertValidField(6, "2000.00", 2000m, dataRow1, dataRow1.Fields[6]);
            AssertValidField(7, "", "", dataRow1, dataRow1.Fields[7]);

            var dataRow2 = actual.DataRows[2];

            Assert.AreEqual(3, dataRow2.Index);
            Assert.AreEqual(ValidationResultType.Valid, dataRow2.ValidationResult);
            Assert.AreEqual("BALANCE,1003,111-22-1003,fname-03,lname-03,10232000,3000.00,", dataRow2.Raw);
            Assert.AreEqual("BALANCE,1003,111-22-1003,fname-03,lname-03,10232000,3000.00,", string.Join(',', dataRow2.RawFields));
            Assert.AreEqual(0, dataRow2.Errors.Count);
            Assert.AreEqual(0, dataRow2.Warnings.Count);
            Assert.AreEqual("{\"RecordType\":\"BALANCE\",\"ConsumerID\":1003,\"SSN\":\"111-22-1003\",\"FirstName\":\"fname-03\",\"LastName\":\"lname-03\",\"DOB\":\"2000-10-23T00:00:00\",\"Balance\":3000.00,\"CustomField\":\"\"}", dataRow2.Json);

            Assert.AreEqual(8, dataRow2.Fields.Count);
            AssertValidField(0, "BALANCE", "BALANCE", dataRow2, dataRow2.Fields[0]);
            AssertValidField(1, "1003", 1003, dataRow2, dataRow2.Fields[1]);
            AssertValidField(2, "111-22-1003", "111-22-1003", dataRow2, dataRow2.Fields[2]);
            AssertValidField(3, "fname-03", "fname-03", dataRow2, dataRow2.Fields[3]);
            AssertValidField(4, "lname-03", "lname-03", dataRow2, dataRow2.Fields[4]);
            AssertValidField(5, "10232000", new DateTime(2000, 10, 23), dataRow2, dataRow2.Fields[5]);
            AssertValidField(6, "3000.00", 3000m, dataRow2, dataRow2.Fields[6]);
            AssertValidField(7, "", "", dataRow2, dataRow2.Fields[7]);
        }