예제 #1
0
        public void ValidateDataTypeException_3()
        {
            OwlFlatFileConfig owlConfig = GetConfig(@"examples\flatfile\3\owl-config-flatfile.xml");

            FlatFileDocument document = new FlatFileDocument();
            string           original = GetContent(@"examples\flatfile\3\test.txt");

            document.LoadContent(owlConfig, original);

            string content = document.ToString();
        }
예제 #2
0
        public void ValidateContent_1()
        {
            OwlFlatFileConfig owlConfig = GetConfig(@"examples\flatfile\1\owl-config-flatfile.xml");

            FlatFileDocument document = new FlatFileDocument();
            string           original = GetContent(@"examples\flatfile\1\test.txt");

            document.LoadContent(owlConfig, original);

            string content = document.ToString();

            Assert.AreEqual(original, content);
        }
예제 #3
0
        public void ValidateDataTypeMessage_3()
        {
            try
            {
                OwlFlatFileConfig owlConfig = GetConfig(@"examples\flatfile\3\owl-config-flatfile.xml");

                FlatFileDocument document = new FlatFileDocument();
                string           original = GetContent(@"examples\flatfile\3\test.txt");
                document.LoadContent(owlConfig, original);

                string content = document.ToString();
            }
            catch (OwlDataTypeException e)
            {
                Assert.AreEqual("The element: 'enc_1' - section: 'ENC' have data-type: 'int' and the sent value is: '770.2'", e.Message);
            }
        }
예제 #4
0
        public void ValidateRequiredMessage_2()
        {
            try
            {
                OwlFlatFileConfig owlConfig = GetConfig(@"examples\flatfile\2\owl-config-flatfile.xml");

                FlatFileDocument document = new FlatFileDocument();
                string           original = GetContent(@"examples\flatfile\2\test.txt");
                document.LoadContent(owlConfig, original);

                string content = document.ToString();
            }
            catch (OwlRequiredException e)
            {
                Assert.AreEqual("The element: 'enc_1' - section: 'ENC' is required", e.Message);
            }
        }
예제 #5
0
        public void ValidateLengthTypeMessage_4()
        {
            try
            {
                OwlFlatFileConfig owlConfig = GetConfig(@"examples\flatfile\4\owl-config-flatfile.xml");

                FlatFileDocument document = new FlatFileDocument();
                string           original = GetContent(@"examples\flatfile\4\test.txt");
                document.LoadContent(owlConfig, original);

                string content = document.ToString();
            }
            catch (OwlLengthException e)
            {
                Assert.AreEqual("The element: 'loc_1' - section: 'LOC' have length: '3' and the allowed length is: '2' - sent value is: '770'", e.Message);
            }
        }