예제 #1
0
        public void Test_TAGFile_Read_File()
        {
            // Create the TAG file and reader classes
            TAGFile file = new TAGFile();

            // Create the state and sink
            TAGProcessorStateBase stateBase = new TAGProcessorStateBase(); // Derivatives to construct later
            TAGValueSink          sink      = new TAGValueSink(stateBase);

            //Read the TAG file
            TAGReadResult result = file.Read(Path.Combine("TestData", "TAGFiles", "TestTAGFile-TAGFile-Read-File.tag"), sink);

            Assert.Equal(TAGReadResult.NoError, result);
        }
예제 #2
0
        public void Test_TAGFile_Read_Stream()
        {
            // Create the TAG file and reader classes
            TAGFile file = new TAGFile();

            using (var reader = new TAGReader(new FileStream(
                                                  Path.Combine("TestData", "TAGFiles", "TestTAGFile-TAGFile-Read-Stream.tag"), FileMode.Open,
                                                  FileAccess.Read)))
            {
                // Create the state and sink
                TAGProcessorStateBase stateBase = new TAGProcessorStateBase(); // Derivatives to construct later
                TAGValueSink          sink      = new TAGValueSink(stateBase);

                //Read the TAG file
                TAGReadResult result = file.Read(reader, sink);

                Assert.Equal(TAGReadResult.NoError, result);
            }
        }