fix for failing tests due missing path to schema

This commit is contained in:
Dimitrij
2021-12-20 11:28:01 +00:00
parent 8fe1bdf39a
commit 72b9190e2f
2 changed files with 9 additions and 23 deletions

View File

@@ -17,20 +17,20 @@ namespace mRemoteNGTests
public string GetTargetPath([CallerFilePath] string sourceFilePath = "")
{
const string debugOrRelease =
#if DEBUG
#if DEBUG
"Debug";
#else
#else
"Release";
#endif
#endif
const string normalOrPortable =
#if PORTABLE
" Portable";
#else
#if PORTABLE
" Portable";
#else
"";
#endif
#endif
var path = Path.GetDirectoryName(sourceFilePath);
var filePath = $"{path}\\..\\mRemoteNG\\bin\\{debugOrRelease}{normalOrPortable}\\mRemoteNG.exe";
var filePath = $"{path}\\..\\mRemoteNG\\bin\\x64\\{debugOrRelease}{normalOrPortable}\\mRemoteNG.exe";
return filePath;
}

View File

@@ -49,7 +49,6 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
{
var sb = new StringBuilder();
var xml = _serializer.Serialize(_connectionTreeModel);
var schemaFileName = $"mremoteng_confcons_v{_serializer.Version.Major}_{_serializer.Version.Minor}.xsd";
var schemaFile = GetTargetPath(schemaFileName);
_xmlReaderSettings.Schemas.Add("http://mremoteng.org", schemaFile);
@@ -69,21 +68,8 @@ namespace mRemoteNGTests.Config.Serializers.ConnectionSerializers.Xml
public string GetTargetPath(string fileName, [CallerFilePath] string sourceFilePath = "")
{
const string debugOrRelease =
#if DEBUG
"Debug";
#else
"Release";
#endif
const string normalOrPortable =
#if PORTABLE
" Portable";
#else
"";
#endif
var path = Path.GetDirectoryName(sourceFilePath);
var filePath = $@"{path}\..\..\..\..\..\mRemoteNG\bin\{debugOrRelease}{normalOrPortable}\Schemas\{fileName}";
var filePath = $@"{path}\..\..\..\..\..\mRemoteNG\Schemas\{fileName}";
return filePath;
}