예제 #1
0
        public void SuggestDataTypeTest()
        {
            PipelineContext pipelineContext = new PipelineContext()
            {
                FirstLineContainsHeaders = true,
                SourceFilePath           = @"..\..\..\D2S.LibraryTests\DataTypes.txt",
                StringPadding            = 100
            };
            DataTypeSuggester suggester = new DataTypeSuggester(pipelineContext);

            string[] result = suggester.SuggestDataType();

            Assert.IsTrue(result[0] == "NVARCHAR(6)");
            Assert.IsTrue(result[1] == "INT");
            Assert.IsTrue(result[2] == "DEC(38,8)");
            Assert.IsTrue(result[3] == "CHAR");

            //check if dial sources would go correctly
            pipelineContext.SourceFileIsSourcedFromDial = true;
            result = suggester.SuggestDataType();
            Assert.IsTrue(result[0].Equals("NVARCHAR(2)"));
            Assert.IsTrue(result[1] == "INT");
            Assert.IsTrue(result[2] == "DEC(38,8)");
            Assert.IsTrue(result[3] == "CHAR");
        }
예제 #2
0
        public void SuggestDataTypeTest()
        {
            PipeLineContext c = new PipeLineContext();

            c.PathToSourceFile = @"C:\Users\C51188\Documents\Axiom ultimo Jan 2018.txt";
            c.FieldDelimiter   = '\t';
            DataTypeSuggester killssis = new DataTypeSuggester(c);

            string[] result = killssis.SuggestDataType().Result;

            foreach (string s in result)
            {
                Console.WriteLine(s);
            }
        }