예제 #1
0
        public void InvalidMissingField()
        {
            string input     = "TestFiles\\invalid_missingfield.csv";
            string output    = "invalid_missingfield.json";
            char   separator = ',';
            var    cx        = new CsvImport(input, output, separator);

            Assert.ThrowsException <Exception>(() => cx.Parse());
        }
예제 #2
0
        public void InvalidMultipleOrder()
        {
            string input     = "TestFiles\\invalid_multiple_order.csv";
            string output    = "invalid_multiple_order.json";
            char   separator = ',';
            var    cx        = new CsvImport(input, output, separator);

            Assert.ThrowsException <NotImplementedException>(() => cx.Parse());
        }
예제 #3
0
        public void ValidSingleOrder()
        {
            string input     = "TestFiles\\valid_single_order.csv";
            string output    = "valid_single_order.json";
            char   separator = ',';
            var    cx        = new CsvImport(input, output, separator);

            cx.Parse();
            string errors = cx.ValidateImport();
            var    fn     = cx.SaveOutputToFile();

            TestFileCleanup(fn);
            Assert.IsTrue(string.IsNullOrWhiteSpace(errors));
        }