Skip to content

Commit

Permalink
React to changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanbrandenburg committed Jan 24, 2019
1 parent dd78967 commit 1031232
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Extensions.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/Hosting/Hosting/test/HostBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
using System.Runtime.CompilerServices;

[assembly: InternalsVisibleTo("Microsoft.JSInterop.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
[assembly: InternalsVisibleTo("Microsoft.JSInterop.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Threading.Tasks;
using Xunit;

namespace Microsoft.JSInterop.Test
namespace Microsoft.JSInterop.Tests
{
public class DotNetDispatcherTest
{
Expand Down Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Threading.Tasks;
using Xunit;

namespace Microsoft.JSInterop.Test
namespace Microsoft.JSInterop.Tests
{
public class DotNetObjectRefTest
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Linq;
using Xunit;

namespace Microsoft.JSInterop.Test
namespace Microsoft.JSInterop.Tests
{
public class JSInProcessRuntimeBaseTest
{
Expand All @@ -21,7 +21,7 @@ public void DispatchesSyncCallsAndDeserializesResults()
};

// Act
var syncResult = runtime.Invoke<TestDTO>("test identifier 1", "arg1", 123, true );
var syncResult = runtime.Invoke<TestDTO>("test identifier 1", "arg1", 123, true);
var call = runtime.InvokeCalls.Single();

// Assert
Expand Down
4 changes: 2 additions & 2 deletions src/JSInterop/Microsoft.JSInterop/test/JSRuntimeBaseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Linq;
using Xunit;

namespace Microsoft.JSInterop.Test
namespace Microsoft.JSInterop.Tests
{
public class JSRuntimeBaseTest
{
Expand All @@ -18,7 +18,7 @@ public void DispatchesAsyncCallsWithDistinctAsyncHandles()
var runtime = new TestJSRuntime();

// Act
runtime.InvokeAsync<object>("test identifier 1", "arg1", 123, true );
runtime.InvokeAsync<object>("test identifier 1", "arg1", 123, true);
runtime.InvokeAsync<object>("test identifier 2", "some other arg");

// Assert
Expand Down
2 changes: 1 addition & 1 deletion src/JSInterop/Microsoft.JSInterop/test/JSRuntimeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Threading.Tasks;
using Xunit;

namespace Microsoft.JSInterop.Test
namespace Microsoft.JSInterop.Tests
{
public class JSRuntimeTest
{
Expand Down
12 changes: 6 additions & 6 deletions src/JSInterop/Microsoft.JSInterop/test/JsonUtilTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Collections.Generic;
using Xunit;

namespace Microsoft.JSInterop.Test
namespace Microsoft.JSInterop.Tests
{
public class JsonUtilTest
{
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -222,12 +222,12 @@ public void NonEmptyConstructorThrowsUsefulException()
// Act
var exception = Assert.Throws<InvalidOperationException>(() =>
{
Json.Deserialize<NonEmptyConstructorPoco>(json);
Json.Deserialize<NonEmptyConstructorPoco>(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);
}

Expand Down Expand Up @@ -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; }
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 1031232

Please sign in to comment.