示例#1
0
        public void ProcessResult_WhenCreatedWithValidUri_ReturnsUri()
        {
            var response = new FakeResponseContext();
            var result = new RedirectResult("someuri");

            Assert.That(result.Uri, Is.EqualTo("someuri"));

            result.ProcessResult(null, response);

            Assert.That(response.RedirectUrl, Is.EqualTo("someuri"));
        }
示例#2
0
        public void ProcessResult_WhenCreatedWithValidHandler_ReturnsHandlerUri()
        {
            Url.ApplicationPathProvider = new FakeApplicationPathProvider();

            Tinyweb.Handlers = new[] { new HandlerData { Type = typeof(Resource1Handler), Uri = "uri" } };

            var response = new FakeResponseContext();
            var result = new RedirectResult<Resource1Handler>();

            Assert.That(result.Uri, Is.EqualTo("/uri"));

            result.ProcessResult(null, response);

            Assert.That(response.RedirectUrl, Is.EqualTo("/uri"));
        }