public void TestDataConverter()
        {
            MarkerClass markerClass = new MarkerClass();

            DataConverter dataConverter = new DataConverter();

            DCMapping mapping;
            DCMapping[] mappings = new DCMapping[markerClass.markers.Length];

            for (int i = 0; i < markerClass.markers.Length; i++)
            {
                MarkerClass.Marker marker = markerClass.markers[i];

                mapping = new DCMapping();
                mapping.BeginMarker = marker.m_marker;

                // the sample input file is ASCII text, so using ISO-8859-1 (Latin 1)
                // to convert to Unicode is a good choice. By specifiying an empty string
                // as the encoding name, the default Unicode conversion will be used,
                // which is ISO-8859-1 (Latin 1).
                mapping.MarkerEncoding = "";
                mapping.DataEncoding = "";

                mapping.IsInline = marker.m_isInline;
                mapping.EndMarker = marker.m_end;

                mappings[i] = mapping;
            }

            // location of sample sfm files
            string SFMFilePath = Info.TestFileDir;

            //			IECProjectFileInfo fileInfo;
            //			IECProjectFileInfo[] fileInfos = new IECProjectFileInfo[1];
            DCFileInfo fileInfo;
            IDCFileInfo[] fileInfos = new IDCFileInfo[1];

            //			fileInfo = new ECProjectFileInfo();
            fileInfo = new DCFileInfo();
            fileInfo.InputFileName = SFMFilePath + @"input.sfm";
            fileInfo.OutputFileName = SFMFilePath + @"output.sfm";

            // fileInfo.HasBOM is initialized to 0 ... which works for this test.
            fileInfo.FileEncoding = DCFileEncoding.DC_FE_BYTES;

            fileInfos[0] = fileInfo;

            // convert the input files
            dataConverter.ConvertNew(mappings, fileInfos);
        }
        public void SetUpTokenizer()
        {
            MarkerClass markerClass = new MarkerClass();

            m_tokenizer = new Tokenizer();
            MarkerSpec ms;
            for (int i = 0; i < markerClass.markers.Length; i++)
            {
                MarkerClass.Marker marker = markerClass.markers[i];

                // This test does not use an ECMapping object because it modifies replaceMarker
                // and endReplaceMarker automatically, and since we are just testing the tokenizer,
                // we don't want to have to account for markers being replaced. The replace marker functionality
                // is tested elsewhere.
                ms = MarkerSpec.CreateMarkerSpec(marker.m_marker, marker.m_markerMap,
                    marker.m_dataMap, marker.m_isInline, marker.m_marker, marker.m_end, marker.m_end);

                m_tokenizer.Tri.Add(ms);
            }
        }
        public void TestInvalidFileName()
        {
            MarkerClass markerClass = new MarkerClass();

            DataConverter dataConverter = new DataConverter();

            DCMapping mapping;
            DCMapping[] mappings = new DCMapping[markerClass.markers.Length];

            for (int i = 0; i < markerClass.markers.Length; i++)
            {
                MarkerClass.Marker marker = markerClass.markers[i];

                mapping = new DCMapping();
                mapping.BeginMarker = marker.m_marker;

                // use an undefined Encoding Repository name
                mapping.MarkerEncoding = "";
                mapping.DataEncoding = "";

                mapping.IsInline = marker.m_isInline;
                mapping.EndMarker = marker.m_end;

                mappings[i] = mapping;
            }

            // location of sample sfm files
            string SFMFilePath = Info.TestFileDir;

            DCFileInfo fileInfo;
            IDCFileInfo[] fileInfos = new IDCFileInfo[1];

            fileInfo = new DCFileInfo();
            fileInfo.InputFileName = SFMFilePath + @"inputxxxxx.sfm";
            fileInfo.OutputFileName = SFMFilePath + @"output.sfm";

            // fileInfo.HasBOM is initialized to 0 ... which works for this test.
            fileInfo.FileEncoding = DCFileEncoding.DC_FE_BYTES;

            fileInfos[0] = fileInfo;

            // convert the input files
            try
            {
                dataConverter.ConvertNew(mappings, fileInfos);
                Assert.Fail("ConvertNew didn't fail with non-existant input file.");
            }
            catch(System.IO.FileNotFoundException)
            {
            }
            catch(Exception e)
            {
                Assert.Fail("Unexpected Exception: " + e.Message);
            }
        }