Beispiel #1
0
        public void WindowsFileReopen()
        {
            if (!Global.TestWindows)
            {
                throw new Exception("Windows Tests Are Not Enabled.  Set Global.TestWindows To True To Enable.");
            }

            String path = Path.Combine(Global.WindowsWorkingPath, $"{Global.RandomFile}");

            Console.WriteLine(path);
            ZephyrFile file = new WindowsZephyrFile(path);

            System.IO.Stream stream = file.Open(AccessType.Read);
            Assert.That(stream.CanRead);
            Assert.That(!stream.CanWrite);

            stream = file.Reopen(AccessType.Write);
            Assert.That(!stream.CanRead);
            Assert.That(stream.CanWrite);

            file.Close();
            file.Delete();
        }