From 5d2b1000f19dc3e892611f387b46cd519976a9f0 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 22 Aug 2017 18:22:17 -0700 Subject: [PATCH] Upgrade to xunit 2.3.0-beta4 Includes a few changes as required by the new analyzers in the upgrade. --- build/common.props | 2 ++ build/dependencies.props | 5 +++-- .../StaticFileMiddlewareTests.cs | 4 ++-- .../CacheHeaderTests.cs | 4 ++-- .../DefaultFilesMiddlewareTests.cs | 2 +- .../DirectoryBrowserMiddlewareTests.cs | 4 ++-- .../Microsoft.AspNetCore.StaticFiles.Tests.csproj | 1 + .../StaticFileMiddlewareTests.cs | 6 +++--- 8 files changed, 16 insertions(+), 12 deletions(-) diff --git a/build/common.props b/build/common.props index a048198bf3..0229049141 100644 --- a/build/common.props +++ b/build/common.props @@ -11,6 +11,8 @@ true $(VersionSuffix)-$(BuildNumber) true + + $(NoWarn);AD0001 diff --git a/build/dependencies.props b/build/dependencies.props index a7de3e4e3f..71f76db82a 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -5,7 +5,8 @@ 2.1.1-* 2.0.0-* 2.0.0-* - 15.3.0-* - 2.3.0-beta2-* + 15.3.0 + 0.6.1 + 2.3.0-beta4-build3742 diff --git a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs index dcaace1874..b2ba4a4f47 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.FunctionalTests/StaticFileMiddlewareTests.cs @@ -146,12 +146,12 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); - Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + Assert.Empty((await response.Content.ReadAsByteArrayAsync())); } } } - public static IEnumerable ExistingFiles => new[] + public static IEnumerable ExistingFiles => new[] { new[] {"", @".", "/TestDocument.txt"}, new[] {"/somedir", @".", "/somedir/TestDocument.txt"}, diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs index bb83365fcb..862346a9d8 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/CacheHeaderTests.cs @@ -412,13 +412,13 @@ namespace Microsoft.AspNetCore.StaticFiles } - public static IEnumerable SupportedMethods => new[] + public static IEnumerable SupportedMethods => new[] { new [] { HttpMethod.Get }, new [] { HttpMethod.Head } }; - public static IEnumerable UnsupportedMethods => new[] + public static IEnumerable UnsupportedMethods => new[] { new [] { HttpMethod.Post }, new [] { HttpMethod.Put }, diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs index c8ca085aca..e50557f277 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/DefaultFilesMiddlewareTests.cs @@ -142,7 +142,7 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal(HttpStatusCode.Moved, response.StatusCode); Assert.Equal(requestUrl + "/" + queryString, response.Headers.GetValues("Location").FirstOrDefault()); - Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + Assert.Empty((await response.Content.ReadAsByteArrayAsync())); } } diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs index c1aff43907..2a12c85486 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/DirectoryBrowserMiddlewareTests.cs @@ -165,7 +165,7 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal(HttpStatusCode.Moved, response.StatusCode); Assert.Equal(requestUrl + "/" + queryString, response.Headers.GetValues("Location").FirstOrDefault()); - Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + Assert.Empty((await response.Content.ReadAsByteArrayAsync())); } } @@ -241,7 +241,7 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal("text/html; charset=utf-8", response.Content.Headers.ContentType.ToString()); Assert.True(response.Content.Headers.ContentLength == 0); - Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + Assert.Empty((await response.Content.ReadAsByteArrayAsync())); } } } diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj index 17d3e8dbb4..ca1260e87b 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/Microsoft.AspNetCore.StaticFiles.Tests.csproj @@ -23,6 +23,7 @@ + diff --git a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs index d1630ce55b..7517782e51 100644 --- a/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs +++ b/test/Microsoft.AspNetCore.StaticFiles.Tests/StaticFileMiddlewareTests.cs @@ -128,7 +128,7 @@ namespace Microsoft.AspNetCore.StaticFiles Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal("text/plain", response.Content.Headers.ContentType.ToString()); Assert.True(response.Content.Headers.ContentLength == fileInfo.Length); - Assert.Equal(0, (await response.Content.ReadAsByteArrayAsync()).Length); + Assert.Empty((await response.Content.ReadAsByteArrayAsync())); } } @@ -187,7 +187,7 @@ namespace Microsoft.AspNetCore.StaticFiles } } - public static IEnumerable MissingFiles => new[] + public static IEnumerable MissingFiles => new[] { new[] {"", @".", "/missing.file"}, new[] {"/subdir", @".", "/subdir/missing.file"}, @@ -195,7 +195,7 @@ namespace Microsoft.AspNetCore.StaticFiles new[] {"", @"./", "/xunit.xml"} }; - public static IEnumerable ExistingFiles => new[] + public static IEnumerable ExistingFiles => new[] { new[] {"", @".", "/TestDocument.txt"}, new[] {"/somedir", @".", "/somedir/TestDocument.txt"},