blob: a6fc4d31f8d71bfc871fa80a5875ea44ee0476fb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Microsoft.AspNetCore.Internal;
using Xunit;
namespace Microsoft.AspNetCore.Http.Result;
public class RedirectResultTest : RedirectResultTestBase
{
[Fact]
public void RedirectResult_Constructor_WithParameterUrlPermanentAndPreservesMethod_SetsResultUrlPermanentAndPreservesMethod()
{
// Arrange
var url = "/test/url";
// Act
var result = new RedirectResult(url, permanent: true, preserveMethod: true);
// Assert
Assert.True(result.PreserveMethod);
Assert.True(result.Permanent);
Assert.Same(url, result.Url);
}
protected override Task ExecuteAsync(HttpContext httpContext, string contentPath)
{
var redirectResult = new RedirectResult(contentPath, false, false);
return redirectResult.ExecuteAsync(httpContext);
}
}
|