mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-06-20 08:38:15 +08:00
changed file config stuff to just use app base directory
This commit is contained in:
@ -1,36 +1,9 @@
|
||||
namespace Ocelot.AcceptanceTests
|
||||
{
|
||||
using System.Runtime.InteropServices;
|
||||
using System;
|
||||
|
||||
namespace Ocelot.AcceptanceTests
|
||||
{
|
||||
public static class TestConfiguration
|
||||
{
|
||||
public static double Version => 1.1;
|
||||
public static string ConfigurationPath => GetConfigurationPath();
|
||||
|
||||
public static string GetConfigurationPath()
|
||||
{
|
||||
var osArchitecture = RuntimeInformation.OSArchitecture.ToString();
|
||||
|
||||
if(RuntimeInformation.OSDescription.ToLower().Contains("darwin"))
|
||||
{
|
||||
return FormatConfigurationPath("osx.10.11", osArchitecture);
|
||||
}
|
||||
|
||||
if(RuntimeInformation.OSDescription.ToLower().Contains("microsoft windows 10"))
|
||||
{
|
||||
return FormatConfigurationPath("win10", osArchitecture);
|
||||
}
|
||||
|
||||
return FormatConfigurationPath("win7", osArchitecture);
|
||||
}
|
||||
|
||||
private static string FormatConfigurationPath(string oSDescription, string osArchitecture)
|
||||
{
|
||||
var runTime = $"{oSDescription}-{osArchitecture}".ToLower();
|
||||
|
||||
var configPath = $"./test/Ocelot.AcceptanceTests/bin/Debug/netcoreapp{Version}/{runTime}/configuration.json";
|
||||
|
||||
return configPath;
|
||||
}
|
||||
public static string ConfigurationPath => $"{AppContext.BaseDirectory}/configuration.json";
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user