diff --git a/Extensions.sln b/Extensions.sln index 0eb0687a0f8..a58775cca58 100644 --- a/Extensions.sln +++ b/Extensions.sln @@ -289,7 +289,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "JSInterop", "JSInterop", "{ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.JSInterop", "src\JSInterop\Microsoft.JSInterop\src\Microsoft.JSInterop.csproj", "{6D3807BD-28A8-4B7C-92D2-8A72E1522398}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.JSInterop.Test", "src\JSInterop\Microsoft.JSInterop\test\Microsoft.JSInterop.Test.csproj", "{FD4896CE-E3FB-458E-8581-7552347C4260}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.JSInterop.Tests", "src\JSInterop\Microsoft.JSInterop\test\Microsoft.JSInterop.Tests.csproj", "{FD4896CE-E3FB-458E-8581-7552347C4260}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.JSInterop.JS", "src\JSInterop\Microsoft.JSInterop.JS\src\Microsoft.JSInterop.JS.csproj", "{76258B76-8CDD-471A-9D43-0815B712D668}" EndProject diff --git a/src/Hosting/Hosting/test/HostBuilderTests.cs b/src/Hosting/Hosting/test/HostBuilderTests.cs index 144fb0ad959..44b2fd77336 100644 --- a/src/Hosting/Hosting/test/HostBuilderTests.cs +++ b/src/Hosting/Hosting/test/HostBuilderTests.cs @@ -119,8 +119,7 @@ public void CanConfigureAppConfigurationAndRetrieveFromDI() public void CanConfigureAppConfigurationFromFile() { // Needs to look in the project directory like VS would - var projectDir = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("Hosting"), - "Hosting/test"); + var projectDir = Path.Combine(TestPathUtilities.GetRepoRootDirectory(), "src", "Hosting", "Hosting", "test"); var hostBuilder = new HostBuilder() .UseContentRoot(projectDir) .ConfigureAppConfiguration((context, configBuilder) => diff --git a/src/JSInterop/Microsoft.JSInterop/src/Properties/AssemblyInfo.cs b/src/JSInterop/Microsoft.JSInterop/src/Properties/AssemblyInfo.cs index d65c89dc7f1..07d0f1922f8 100644 --- a/src/JSInterop/Microsoft.JSInterop/src/Properties/AssemblyInfo.cs +++ b/src/JSInterop/Microsoft.JSInterop/src/Properties/AssemblyInfo.cs @@ -1,3 +1,3 @@ using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("Microsoft.JSInterop.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: InternalsVisibleTo("Microsoft.JSInterop.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/JSInterop/Microsoft.JSInterop/test/DotNetDispatcherTest.cs b/src/JSInterop/Microsoft.JSInterop/test/DotNetDispatcherTest.cs index eec537f987d..8ab470d1d81 100644 --- a/src/JSInterop/Microsoft.JSInterop/test/DotNetDispatcherTest.cs +++ b/src/JSInterop/Microsoft.JSInterop/test/DotNetDispatcherTest.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Xunit; -namespace Microsoft.JSInterop.Test +namespace Microsoft.JSInterop.Tests { public class DotNetDispatcherTest { @@ -320,7 +320,8 @@ public class SomePublicType protected static void StaticMethodWithoutAttribute() { } protected static void InstanceMethodWithoutAttribute() { } - [JSInvokable("InvocableStaticVoid")] public static void MyInvocableVoid() + [JSInvokable("InvocableStaticVoid")] + public static void MyInvocableVoid() { DidInvokeMyInvocableStaticVoid = true; } diff --git a/src/JSInterop/Microsoft.JSInterop/test/DotNetObjectRefTest.cs b/src/JSInterop/Microsoft.JSInterop/test/DotNetObjectRefTest.cs index 969dcae79d9..1bdec6d4652 100644 --- a/src/JSInterop/Microsoft.JSInterop/test/DotNetObjectRefTest.cs +++ b/src/JSInterop/Microsoft.JSInterop/test/DotNetObjectRefTest.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Xunit; -namespace Microsoft.JSInterop.Test +namespace Microsoft.JSInterop.Tests { public class DotNetObjectRefTest { diff --git a/src/JSInterop/Microsoft.JSInterop/test/JSInProcessRuntimeBaseTest.cs b/src/JSInterop/Microsoft.JSInterop/test/JSInProcessRuntimeBaseTest.cs index d2e71f6eb21..36474fe4071 100644 --- a/src/JSInterop/Microsoft.JSInterop/test/JSInProcessRuntimeBaseTest.cs +++ b/src/JSInterop/Microsoft.JSInterop/test/JSInProcessRuntimeBaseTest.cs @@ -6,7 +6,7 @@ using System.Linq; using Xunit; -namespace Microsoft.JSInterop.Test +namespace Microsoft.JSInterop.Tests { public class JSInProcessRuntimeBaseTest { @@ -21,7 +21,7 @@ public void DispatchesSyncCallsAndDeserializesResults() }; // Act - var syncResult = runtime.Invoke("test identifier 1", "arg1", 123, true ); + var syncResult = runtime.Invoke("test identifier 1", "arg1", 123, true); var call = runtime.InvokeCalls.Single(); // Assert diff --git a/src/JSInterop/Microsoft.JSInterop/test/JSRuntimeBaseTest.cs b/src/JSInterop/Microsoft.JSInterop/test/JSRuntimeBaseTest.cs index 9193d6deb8d..ab048e812fe 100644 --- a/src/JSInterop/Microsoft.JSInterop/test/JSRuntimeBaseTest.cs +++ b/src/JSInterop/Microsoft.JSInterop/test/JSRuntimeBaseTest.cs @@ -7,7 +7,7 @@ using System.Linq; using Xunit; -namespace Microsoft.JSInterop.Test +namespace Microsoft.JSInterop.Tests { public class JSRuntimeBaseTest { @@ -18,7 +18,7 @@ public void DispatchesAsyncCallsWithDistinctAsyncHandles() var runtime = new TestJSRuntime(); // Act - runtime.InvokeAsync("test identifier 1", "arg1", 123, true ); + runtime.InvokeAsync("test identifier 1", "arg1", 123, true); runtime.InvokeAsync("test identifier 2", "some other arg"); // Assert diff --git a/src/JSInterop/Microsoft.JSInterop/test/JSRuntimeTest.cs b/src/JSInterop/Microsoft.JSInterop/test/JSRuntimeTest.cs index d5fed45ea4f..b8a1c363dc9 100644 --- a/src/JSInterop/Microsoft.JSInterop/test/JSRuntimeTest.cs +++ b/src/JSInterop/Microsoft.JSInterop/test/JSRuntimeTest.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using Xunit; -namespace Microsoft.JSInterop.Test +namespace Microsoft.JSInterop.Tests { public class JSRuntimeTest { diff --git a/src/JSInterop/Microsoft.JSInterop/test/JsonUtilTest.cs b/src/JSInterop/Microsoft.JSInterop/test/JsonUtilTest.cs index 1be98b681e1..2b239faab9c 100644 --- a/src/JSInterop/Microsoft.JSInterop/test/JsonUtilTest.cs +++ b/src/JSInterop/Microsoft.JSInterop/test/JsonUtilTest.cs @@ -6,7 +6,7 @@ using System.Collections.Generic; using Xunit; -namespace Microsoft.JSInterop.Test +namespace Microsoft.JSInterop.Tests { public class JsonUtilTest { @@ -124,10 +124,10 @@ public void CanSerializeStructToJson() BoolProperty = true, NullableIntProperty = 1 }; - + // Act var result = Json.Serialize(commandResult); - + // Assert Assert.Equal("{\"stringProperty\":\"Test\",\"boolProperty\":true,\"nullableIntProperty\":1}", result); } @@ -222,12 +222,12 @@ public void NonEmptyConstructorThrowsUsefulException() // Act var exception = Assert.Throws(() => { - Json.Deserialize(json); + Json.Deserialize(json); }); // Assert Assert.Equal( - $"Cannot deserialize JSON into type '{type.FullName}' because it does not have a public parameterless constructor.", + $"Cannot deserialize JSON into type '{type.FullName}' because it does not have a public parameterless constructor.", exception.Message); } @@ -277,7 +277,7 @@ public void MemberNameToCamelCase_Invalid(string input) class NonEmptyConstructorPoco { - public NonEmptyConstructorPoco(int parameter) {} + public NonEmptyConstructorPoco(int parameter) { } public int Property { get; set; } } diff --git a/src/JSInterop/Microsoft.JSInterop/test/Microsoft.JSInterop.Test.csproj b/src/JSInterop/Microsoft.JSInterop/test/Microsoft.JSInterop.Tests.csproj similarity index 100% rename from src/JSInterop/Microsoft.JSInterop/test/Microsoft.JSInterop.Test.csproj rename to src/JSInterop/Microsoft.JSInterop/test/Microsoft.JSInterop.Tests.csproj diff --git a/src/TestingUtils/Microsoft.AspNetCore.Testing/src/TestPathUtilities.cs b/src/TestingUtils/Microsoft.AspNetCore.Testing/src/TestPathUtilities.cs index ebd10897c38..f982471f39b 100644 --- a/src/TestingUtils/Microsoft.AspNetCore.Testing/src/TestPathUtilities.cs +++ b/src/TestingUtils/Microsoft.AspNetCore.Testing/src/TestPathUtilities.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// 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; @@ -8,6 +8,11 @@ namespace Microsoft.AspNetCore.Testing { public class TestPathUtilities { + public static string GetRepoRootDirectory() + { + return GetSolutionRootDirectory("Extensions"); + } + public static string GetSolutionRootDirectory(string solution) { var applicationBasePath = AppContext.BaseDirectory;