Ejemplo n.º 1
0
        public void ReadAndWriteOpening()
        {
            int i = 0;

            while (i < 10)
            {
                using (file.OpenForRead())
                {
                }
                using (file.OpenForWrite())
                {
                }
                i++;
            }

            i = 0;
            while (i < 10)
            {
                using (file.OpenForWrite())
                {
                }
                using (file.OpenForRead())
                {
                }
                i++;
            }
        }
Ejemplo n.º 2
0
        public void SkippingUnknownRecords()
        {
            StdfFile file = new StdfFile(filePath);

            using (StdfFileReader reader = file.OpenForRead())
            {
                reader.RecordRead += new RecordReadEventHandler(delegate(object o, RecordReadEventArgs e)
                {
                    Assert.IsNotNull(e.Record);
                });
                try
                {
                    reader.Read();
                }
                catch (Exception e)
                {
                    Assert.Fail(e.Message);
                }
            }
        }