Invalid parsing of System.Uri under NUnit

Reproduced under ReSharper, from GUI-Runner, from NUnit-Console

Tested:

Win 7 Pro, all updates, Ru-ru locale - reproduced

Win Server 2012, all En-us locale updates - reproduced

Try the following:

[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./ " is returned

Actual:

Trimmed " http://host.com/path/ " returned

Notes:

  • It is broken and the trimmed Uri does not match the resource requested

  • This behavior has never occurred in production and cannot be caught except by performing a NUNIT.

  • We compared all the loaded versions of assemblies and the codebase - everything exactly coincided with the production

  • Tested the internet for this problem - nothing

Wish you can reproduce.

NUnit versions 2.6.2 and 2.6.3 have the same behavior.

Have posted us the issue https://github.com/nunit/nunit/issues/237

+3


source to share


1 answer


The guys at NUnit are checking this out and coming up with one of the broken changes to .NET 4.5, so if NUnit gets rebuilt targeting that version should be fine. Uri normalization was a particular bug of all .net versions before, and I'm lucky to have just met it ...



+3


source







All Articles