public void ParseCsvFile_WhenAllGoodValues_NoErrors()
        {
            var classMap  = new TestCsvMap();
            var headerRow = classMap.GetHeaders();
            var dataRow   = new List <string>();

            foreach (var row in headerRow)
            {
                switch (row)
                {
                case TestUploadConstants.StringHeader: dataRow.Add("blah blah blah"); break;

                case TestUploadConstants.NumberHeader: dataRow.Add(123.ToString()); break;

                case TestUploadConstants.DateHeader: dataRow.Add(DateTime.Now.ToString("O")); break;

                case TestUploadConstants.EnumHeader: dataRow.Add(TestUploadEnum.Value1.ToString()); break;

                case TestUploadConstants.EnumCollectionHeader: dataRow.Add(string.Join("|", new[] { TestUploadEnum.Value1, TestUploadEnum.Value2 })); break;
                }
            }

            var result = MapDataAndParse(classMap, headerRow, new[] { dataRow });

            AssertNoErrors(result);
        }
        public void ParseCsvFile_WhenBadValuesGiven_ErrorsExist()
        {
            var classMap  = new TestCsvMap();
            var headerRow = classMap.GetHeaders();
            var dataRow   = new List <string>();

            foreach (var row in headerRow)
            {
                switch (row)
                {
                case TestUploadConstants.StringHeader: dataRow.Add("1"); break;

                case TestUploadConstants.NumberHeader: dataRow.Add("Nopers"); break;

                case TestUploadConstants.DateHeader: dataRow.Add("123"); break;

                case TestUploadConstants.EnumHeader: dataRow.Add("123"); break;

                case TestUploadConstants.EnumCollectionHeader: dataRow.Add("123"); break;
                }
            }

            var result = MapDataAndParse(classMap, headerRow, new[] { dataRow });

            //Expecting every row except for the string to have errors
            var expectedErrors = headerRow.Count() - 1;

            foreach (var item in result.Items)
            {
                Assert.True(item.Errors.Count == headerRow.Count() - 1, $"Must have {expectedErrors} errors but was: {item.Errors.Count}");
            }
        }