Пример #1
0
        public void WriteFile_writes_expected_csv_for_list_of_dynamic()
        {
            var records = new List <dynamic>()
            {
                new { A = "1", B = "2" },
                new { A = "3", B = "4" },
            };

            _sut.WriteFile(records, TestFileName);

            var expectedCsv = "A,B" + Environment.NewLine +
                              "1,2" + Environment.NewLine +
                              "3,4" + Environment.NewLine;

            var actualCsv = File.ReadAllText(TestFileName);

            Assert.Equal(expectedCsv, actualCsv);
        }