Example #1
0
        public virtual void TestPositiveHarFileSystemBasics()
        {
            // check Har version:
            Assert.Equal(HarFileSystem.Version, harFileSystem.GetHarVersion
                             ());
            // check Har URI:
            URI harUri = harFileSystem.GetUri();

            Assert.Equal(harPath.ToUri().GetPath(), harUri.GetPath());
            Assert.Equal("har", harUri.GetScheme());
            // check Har home path:
            Path homePath = harFileSystem.GetHomeDirectory();

            Assert.Equal(harPath.ToUri().GetPath(), homePath.ToUri().GetPath
                             ());
            // check working directory:
            Path workDirPath0 = harFileSystem.GetWorkingDirectory();

            Assert.Equal(homePath, workDirPath0);
            // check that its impossible to reset the working directory
            // (#setWorkingDirectory should have no effect):
            harFileSystem.SetWorkingDirectory(new Path("/foo/bar"));
            Assert.Equal(workDirPath0, harFileSystem.GetWorkingDirectory()
                         );
        }
Example #2
0
        public virtual void TestNegativeGetHarVersionOnNotInitializedFS()
        {
            HarFileSystem hfs = new HarFileSystem(localFileSystem);

            try
            {
                int version = hfs.GetHarVersion();
                NUnit.Framework.Assert.Fail("Exception expected, but got a Har version " + version
                                            + ".");
            }
            catch (IOException)
            {
            }
        }