Exemplo n.º 1
0
        private string EnsureAbsolute(string path)
        {
            if (path.StartsWith("~"))
            {
                path = path.Substring(1);
            }

            if (path.StartsWith("/"))
            {
                path = Path.Combine(AppDomainExtensions.GetPrimaryAssemblyPath(), path.Substring(1));
            }

            return(path);
        }
        protected void Setup()
        {
            var binDirectory = AppDomainExtensions.GetPrimaryAssemblyPath();

            filePath = Path.Combine(binDirectory, "test.trig");
            if (!Directory.Exists(binDirectory))
            {
                Directory.CreateDirectory(binDirectory);
            }

            if (File.Exists(filePath))
            {
                File.Delete(filePath);
            }

            FileStream fileStream = File.Create(filePath);

            GetType().GetTypeInfo().Assembly.GetManifestResourceStream("RomanticWeb.Tests.TestGraphs.TriplesWithLiteralSubjects.trig").CopyTo(fileStream);
            fileStream.Close();
        }