You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the constructor TestDatabaseSetup(Assembly baseAssembly, Assembly[] mappingAssemblies) of TestDatabaseSetup class will fail under Unix-based systems, because UriBuilder can't handle paths which start with slash (\ or /).
E.g.:
/absolute/path/on/linux
\relative\path\on\Windows
(CodeBaseLocator.GetAssemblyCodeBasePath uses the UriBuilder class.)
See "Implicit File Path Support" part of Uri Class documentation on why using this class on Unix-based system is problematic.
Stacktrace
---- System.UriFormatException : Invalid URI: The hostname could not be parsed.
Stack Trace:
----- Inner Stack Trace #1 (System.UriFormatException) -----
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString)
at System.UriBuilder..ctor(String uri)
at SharpArch.Infrastructure.CodeBaseLocator.GetAssemblyCodeBasePath(Assembly assembly)
at SharpArch.Testing.NHibernate.TestDatabaseSetup..ctor(Assembly baseAssembly, Assembly[] mappingAssemblies)
using System;
using SharpArch.Testing.NHibernate;
using Xunit;
namespace SharpArchBug
{
public class BugTest : TestDatabaseSetup
{
public BugTest() : base(typeof(BugTest).Assembly, new[] {typeof(BugTest).Assembly})
{
}
[Fact]
public void Will_Not_Reach_This_On_Linux()
{
Assert.False(false);
}
}
}
Run unittests under Unix-based system.
The text was updated successfully, but these errors were encountered:
Problem
Using the constructor
TestDatabaseSetup(Assembly baseAssembly, Assembly[] mappingAssemblies)
ofTestDatabaseSetup
class will fail under Unix-based systems, becauseUriBuilder
can't handle paths which start with slash (\
or/
).E.g.:
(
CodeBaseLocator.GetAssemblyCodeBasePath
uses theUriBuilder
class.)See "Implicit File Path Support" part of Uri Class documentation on why using this class on Unix-based system is problematic.
Stacktrace
Used
.Net (5.0)
SharpArch.Testing.Xunit.NHibernate (7.0.0)
Xunit (2.4.1)
Microsoft.NET.Test.Sdk (16.11.0)
Steps to reproduce
The text was updated successfully, but these errors were encountered: