Skip to content

Commit 56b1cf4

Browse files
committed
Separates tests out a bit
1 parent 823c9c5 commit 56b1cf4

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed
Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
using System.IO;
2-
using System.Text;
32
using System.Threading.Tasks;
4-
using System.Xml;
53
using System.Xml.Linq;
64
using Xunit;
75

86
namespace Https.Tests
97
{
10-
public class IntegrationTests : IClassFixture<WebHostFixture>
8+
public class ContentTypeTests : IClassFixture<WebHostFixture>
119
{
1210
readonly WebHostFixture _fixture;
13-
public IntegrationTests(WebHostFixture fixture) =>
11+
public ContentTypeTests(WebHostFixture fixture) =>
1412
_fixture = fixture;
1513

1614
[Fact]
@@ -64,19 +62,5 @@ public async Task MirrorTest_ShouldReflectXml()
6462

6563
Assert.Equal(expected, actual);
6664
}
67-
68-
[Fact]
69-
public async Task RedirectTest_ShouldShow3XXResponse_GivenStopAutoRedirects()
70-
{
71-
var args = new[]
72-
{
73-
"get", "http://localhost:5000/Redirect", "--stop-auto-redirects"
74-
};
75-
76-
var result = await Https.ExecuteAsync(args);
77-
78-
Assert.Equal("HTTP/1.1 301 Moved Permanently", result.Status);
79-
Assert.Equal("http://localhost:5000/Mirror", result.Headers["Location"]);
80-
}
8165
}
8266
}

tests/https.Tests/RedirectTests.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System.Threading.Tasks;
2+
using Xunit;
3+
4+
namespace Https.Tests
5+
{
6+
public class RedirectTests : IClassFixture<WebHostFixture>
7+
{
8+
readonly WebHostFixture _fixture;
9+
public RedirectTests(WebHostFixture fixture) =>
10+
_fixture = fixture;
11+
12+
[Fact]
13+
public async Task RedirectTest_ShouldShow3XXResponse_GivenStopAutoRedirects()
14+
{
15+
var args = new[]
16+
{
17+
"get", $"{_fixture.HttpUrl}/Redirect", "--stop-auto-redirects"
18+
};
19+
20+
var result = await Https.ExecuteAsync(args);
21+
22+
Assert.Equal("HTTP/1.1 301 Moved Permanently", result.Status);
23+
Assert.Equal($"{_fixture.HttpUrl}/Mirror", result.Headers["Location"]);
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)