问题
Reproduced under ReSharper, from GUI-Runner, from NUnit-Console
Tested on :
Win 7 Pro, all updates, Ru-ru locale - reproduced
Win Server 2012, all updates En-us locale - reproduced
Try this:
[TestFixture(Description = "Uri .ctors under Nunit must work exactly as no under Nunit")]
public class InvalidUriCtorUnderNnit
{
[Test]
public void PathsWithDotsMustBeParsedWell()
{
const string urlWithDots = "http://host.com/path./";
Assert.AreEqual(urlWithDots, new Uri(urlWithDots).ToString());
}
}
Expected:
Uri not changed and "http://host.com/path./" returned
Actual:
Cropped "http://host.com/path/" returned
Notes:
It's broken, while cropped Uri not matched required resource
This behavior never occured in production and cannot be catched except under NUNIT run.
Have compared all loaded assemblies versions and codebase - all exactly match with production
Have tested Internet on this issue - nothing
Wish you could reproduce.
NUnit version 2.6.2 and 2.6.3 have same behavior.
Have posted us issue to https://github.com/nunit/nunit/issues/237
回答1:
Guys from NUnit check it and founs that it's one of broken changes of .NET 4.5, so if NUnit will be rebuilt targeting this version all will be fine. Uri normalization was a feature-like-bug of all versions of .net before and it was my luck that i have just met it...
来源:https://stackoverflow.com/questions/25968963/invalid-system-uri-parsing-under-nunit