无效的System.Uri NUnit的解析下 [英] Invalid System.Uri parsing under NUnit

查看:141
本文介绍了无效的System.Uri NUnit的解析下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ReSharper的下转载,从GUI的亚军,从NUnit控制台

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

在测试了:

赢7专业版,所有更新,RU-RU区域 - 转载

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

赢Server 2012中,所有更新恩美的语言环境 - 转载

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

试试这个:

[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:

乌里没有改变, http://host.com/path ./ 返回

实际

七分裤 http://host.com/path/ 返回

注:


  1. 它打破,而裁剪乌里不匹配所需的资源

  1. It's broken, while cropped Uri not matched required resource

这行为从未在生产中发生以及除NUNIT跑下无法捕获。

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

希望你能重现。

NUnit的版本2.6.2和2.6 .3相同的行为。

NUnit version 2.6.2 and 2.6.3 have same behavior.

已经发布我们问题的 https://github.com/nunit/nunit/issues/237

推荐答案

这家伙的NUnit检查,并founs,它是的.NET 4.5断的变化之一,所以如果NUnit的将被重建瞄准了这一版本的所有将被罚款。乌里正常化之前,.NET的所有版本的功能样的错误,这是我的运气,我刚刚会见了吧...

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...

这篇关于无效的System.Uri NUnit的解析下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆