Beispiel #1
0
        public void ShouldReturnElementCountFromCsv()
        {
            var csv = "UKPRN\n10001309\n10031241";
            var sut = new CsvService();

            var models = sut.CsvTo <CsvTestModel>(csv);

            Assert.AreEqual(2, models.Count);
        }
Beispiel #2
0
        public void ShouldReturnEmptyEnumerableIfCsvDoesntContainAnything()
        {
            var csv = string.Empty;
            var sut = new CsvService();

            var models = sut.CsvTo <CsvTestModel>(csv);

            Assert.AreEqual(0, models.Count);
        }
Beispiel #3
0
        public void ShouldFindTheValueOfACellInACSV()
        {
            var csv = "UKPRN\n10001309\n10031241";
            var sut = new CsvService();

            var models = sut.CsvTo <CsvTestModel>(csv);

            Assert.AreEqual("10001309", models.First().UkPrn);
        }