コード例 #1
0
        void ResponseFilter_can_patch_html_urls(string suffix, string pre, string expectedPatched, Uri requestUrl = null)
        {
            i18n.EarlyUrlLocalizer obj = new i18n.EarlyUrlLocalizer(new UrlLocalizer());
            string post = obj.ProcessOutgoing(pre, suffix, null);

            Assert.AreEqual(expectedPatched, post);
        }
コード例 #2
0
ファイル: ResponseFilterTests.cs プロジェクト: vhatuncev/i18n
        void Helper_ResponseFilter_can_patch_html_urls(string suffix, string pre, string expectedPatched, string requestUrl = "http://example.com/blog")
        {
            HttpRequestBase  fakeRequest  = Substitute.For <HttpRequestBase>();
            HttpResponseBase fakeResponse = Substitute.For <HttpResponseBase>();
            HttpContextBase  fakeContext  = Substitute.For <HttpContextBase>();

            fakeRequest.Url.Returns(requestUrl.IsSet() ? new Uri(requestUrl) : null);
            fakeResponse.Headers.Returns(new System.Net.WebHeaderCollection
            {
                //{ "Authorization", "xyz" }
            });

            fakeContext.Request.Returns(fakeRequest);
            fakeContext.Response.Returns(fakeResponse);

            i18n.EarlyUrlLocalizer obj = new i18n.EarlyUrlLocalizer(new UrlLocalizer());
            string post = obj.ProcessOutgoingNuggets(pre, suffix, fakeContext);

            Assert.AreEqual(expectedPatched, post);
        }
コード例 #3
0
ファイル: ResponseFilterTests.cs プロジェクト: neo725/i18n
 void ResponseFilter_can_patch_html_urls(string suffix, string pre, string expectedPatched, Uri requestUrl = null)
 {
     i18n.EarlyUrlLocalizer obj = new i18n.EarlyUrlLocalizer(new UrlLocalizer());
     string post = obj.ProcessOutgoing(pre, suffix, null);
     Assert.AreEqual(expectedPatched, post);
 }