diff --git a/test/Microsoft.AspNet.Antiforgery.Test/DefaultAntiforgeryTest.cs b/test/Microsoft.AspNet.Antiforgery.Test/DefaultAntiforgeryTest.cs index 59c45b919c..1a709dccad 100644 --- a/test/Microsoft.AspNet.Antiforgery.Test/DefaultAntiforgeryTest.cs +++ b/test/Microsoft.AspNet.Antiforgery.Test/DefaultAntiforgeryTest.cs @@ -8,9 +8,7 @@ using Microsoft.AspNet.Http; using Microsoft.AspNet.Http.Internal; using Microsoft.Extensions.OptionsModel; using Microsoft.Extensions.WebEncoders.Testing; -#if DNX451 using Moq; -#endif using Xunit; namespace Microsoft.AspNet.Antiforgery @@ -149,8 +147,6 @@ namespace Microsoft.AspNet.Antiforgery exception.Message); } -#if DNX451 - [Fact] public void GetHtml_ExistingInvalidCookieToken_GeneratesANewCookieAndAnAntiforgeryToken() { @@ -496,8 +492,6 @@ namespace Microsoft.AspNet.Antiforgery Assert.Equal(expectedHeaderValue, xFrameOptions); } -#endif - private DefaultAntiforgery GetAntiforgery( AntiforgeryOptions options = null, IAntiforgeryTokenGenerator tokenGenerator = null, @@ -525,8 +519,6 @@ namespace Microsoft.AspNet.Antiforgery return httpContext; } -#if DNX451 - private DefaultAntiforgery GetAntiforgery(AntiforgeryMockContext context) { return GetAntiforgery( @@ -667,8 +659,6 @@ namespace Microsoft.AspNet.Antiforgery public Mock TokenSerializer { get; set; } } -#endif - private class TestOptionsManager : IOptions { public AntiforgeryOptions Value { get; set; } = new AntiforgeryOptions(); diff --git a/test/Microsoft.AspNet.Antiforgery.Test/DefaultAntiforgeryTokenGeneratorTest.cs b/test/Microsoft.AspNet.Antiforgery.Test/DefaultAntiforgeryTokenGeneratorTest.cs index 9f8b9bd2b1..10fd048d19 100644 --- a/test/Microsoft.AspNet.Antiforgery.Test/DefaultAntiforgeryTokenGeneratorTest.cs +++ b/test/Microsoft.AspNet.Antiforgery.Test/DefaultAntiforgeryTokenGeneratorTest.cs @@ -5,9 +5,7 @@ using System; using System.Security.Claims; using System.Security.Cryptography; using Microsoft.AspNet.Http.Internal; -#if DNX451 using Moq; -#endif using Xunit; namespace Microsoft.AspNet.Antiforgery @@ -54,8 +52,6 @@ namespace Microsoft.AspNet.Antiforgery Assert.Empty(fieldToken.AdditionalData); } -#if DNX451 - [Fact] public void GenerateFormToken_AuthenticatedWithoutUsernameAndNoAdditionalData_NoAdditionalData() { @@ -191,7 +187,6 @@ namespace Microsoft.AspNet.Antiforgery Assert.Null(fieldToken.ClaimUid); Assert.Empty(fieldToken.AdditionalData); } -#endif [Fact] public void IsCookieTokenValid_FieldToken_ReturnsFalse() @@ -346,8 +341,6 @@ namespace Microsoft.AspNet.Antiforgery exception.Message); } -#if DNX451 - [Theory] [InlineData("the-user", "the-other-user")] [InlineData("http://example.com/uri-casing", "http://example.com/URI-casing")] @@ -542,7 +535,6 @@ namespace Microsoft.AspNet.Antiforgery // Assert // Nothing to assert - if we got this far, success! } -#endif private static ClaimsIdentity GetAuthenticatedIdentity(string identityUsername) { diff --git a/test/Microsoft.AspNet.Antiforgery.Test/DefaultAntiforgeryTokenSerializerTest.cs b/test/Microsoft.AspNet.Antiforgery.Test/DefaultAntiforgeryTokenSerializerTest.cs index 54fadd4399..0c074a2b13 100644 --- a/test/Microsoft.AspNet.Antiforgery.Test/DefaultAntiforgeryTokenSerializerTest.cs +++ b/test/Microsoft.AspNet.Antiforgery.Test/DefaultAntiforgeryTokenSerializerTest.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -#if DNX451 using System; using System.Collections.Generic; using System.Linq; @@ -185,5 +184,3 @@ namespace Microsoft.AspNet.Antiforgery } } } - -#endif \ No newline at end of file diff --git a/test/Microsoft.AspNet.Antiforgery.Test/DefaultAntiforgeryTokenStoreTest.cs b/test/Microsoft.AspNet.Antiforgery.Test/DefaultAntiforgeryTokenStoreTest.cs index e76f400d87..275632ab4f 100644 --- a/test/Microsoft.AspNet.Antiforgery.Test/DefaultAntiforgeryTokenStoreTest.cs +++ b/test/Microsoft.AspNet.Antiforgery.Test/DefaultAntiforgeryTokenStoreTest.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -#if DNX451 using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -446,5 +445,3 @@ namespace Microsoft.AspNet.Antiforgery } } } - -#endif \ No newline at end of file diff --git a/test/Microsoft.AspNet.Antiforgery.Test/DefaultClaimUidExtractorTest.cs b/test/Microsoft.AspNet.Antiforgery.Test/DefaultClaimUidExtractorTest.cs index fe5511db95..25704e4b96 100644 --- a/test/Microsoft.AspNet.Antiforgery.Test/DefaultClaimUidExtractorTest.cs +++ b/test/Microsoft.AspNet.Antiforgery.Test/DefaultClaimUidExtractorTest.cs @@ -4,9 +4,7 @@ using System; using System.Linq; using System.Security.Claims; -#if DNX451 using Moq; -#endif using Xunit; namespace Microsoft.AspNet.Antiforgery @@ -26,7 +24,6 @@ namespace Microsoft.AspNet.Antiforgery Assert.Null(claimUid); } -#if DNX451 [Fact] public void ExtractClaimUid_Unauthenticated() { @@ -61,7 +58,6 @@ namespace Microsoft.AspNet.Antiforgery Assert.NotNull(claimUid); Assert.Equal("47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=", claimUid); } -#endif [Fact] public void DefaultUniqueClaimTypes_NotPresent_SerializesAllClaimTypes() diff --git a/test/Microsoft.AspNet.Antiforgery.Test/TestOptionsManager.cs b/test/Microsoft.AspNet.Antiforgery.Test/TestOptionsManager.cs index 830d3a7913..c0a47a3537 100644 --- a/test/Microsoft.AspNet.Antiforgery.Test/TestOptionsManager.cs +++ b/test/Microsoft.AspNet.Antiforgery.Test/TestOptionsManager.cs @@ -1,7 +1,6 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -using System; using Microsoft.Extensions.OptionsModel; namespace Microsoft.AspNet.Antiforgery diff --git a/test/Microsoft.AspNet.Antiforgery.Test/project.json b/test/Microsoft.AspNet.Antiforgery.Test/project.json index 3cb8d5fe9d..46fd83f562 100644 --- a/test/Microsoft.AspNet.Antiforgery.Test/project.json +++ b/test/Microsoft.AspNet.Antiforgery.Test/project.json @@ -1,24 +1,28 @@ { - "compilationOptions": { - "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk" + "compilationOptions": { + "warningsAsErrors": true, + "keyFile": "../../tools/Key.snk" + }, + "dependencies": { + "Microsoft.AspNet.Antiforgery": "1.0.0-*", + "Microsoft.AspNet.Http": "1.0.0-*", + "Microsoft.Extensions.DependencyInjection": "1.0.0-*", + "xunit.runner.aspnet": "2.0.0-aspnet-*" + }, + "commands": { + "run": "xunit.runner.aspnet", + "test": "xunit.runner.aspnet" + }, + "frameworks": { + "dnx451": { + "dependencies": { + "Moq": "4.2.1312.1622" + } }, - "dependencies": { - "Microsoft.AspNet.Antiforgery": "1.0.0-*", - "Microsoft.AspNet.Http": "1.0.0-*", - "Microsoft.Extensions.DependencyInjection": "1.0.0-*", - "xunit.runner.aspnet": "2.0.0-aspnet-*" - }, - "commands": { - "run": "xunit.runner.aspnet", - "test": "xunit.runner.aspnet" - }, - "frameworks": { - "dnx451": { - "dependencies": { - "Moq": "4.2.1312.1622" - } - }, - "dnxcore50": { } + "dnxcore50": { + "dependencies": { + "moq.netcore": "4.4.0-beta8" + } } + } }