From 37055517eec452e0aaec5f08ae6010c99ac3fdd0 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Wed, 24 Feb 2016 22:35:20 -0800 Subject: [PATCH] Correct test attributes - #654 - `[IPv6SupportedCondition]` requires `[ConditionalFact]` or `[ConditionalTheory]` --- .../AddressRegistrationTests.cs | 3 ++- .../RequestTests.cs | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs index 9b2689c00a..6a65cb71f9 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs @@ -8,6 +8,7 @@ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Extensions; +using Microsoft.AspNetCore.Testing.xunit; using Microsoft.Extensions.Configuration; using Xunit; @@ -21,7 +22,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests await RegisterAddresses_Success(addressInput, testUrls); } - [Theory, MemberData(nameof(AddressRegistrationDataIPv6))] + [ConditionalTheory, MemberData(nameof(AddressRegistrationDataIPv6))] [IPv6SupportedCondition] public async Task RegisterAddresses_IPv6_Success(string addressInput, string[] testUrls) { diff --git a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/RequestTests.cs b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/RequestTests.cs index cdeeccca4f..5c73e751f2 100644 --- a/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/RequestTests.cs +++ b/test/Microsoft.AspNetCore.Server.Kestrel.FunctionalTests/RequestTests.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Globalization; -using System.Net; using System.Net.Http; using System.Net.Sockets; using System.Text; @@ -11,6 +10,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Testing.xunit; using Microsoft.Extensions.Configuration; using Newtonsoft.Json; using Newtonsoft.Json.Linq; @@ -84,7 +84,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests return TestRemoteIPAddress("localhost", requestAddress, expectAddress); } - [Fact] + [ConditionalFact] [IPv6SupportedCondition] public Task RemoteIPv6Address() { @@ -166,10 +166,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests { break; } - + response.Append(Encoding.ASCII.GetString(buffer, 0, length)); } - + Assert.StartsWith("HTTP/1.1 200 OK", response.ToString()); } }