-
-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cleanup: upgrade test and samples to supported .NET Core versions
- Loading branch information
1 parent
716a21b
commit 7d673f3
Showing
14 changed files
with
199 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,31 @@ | ||
#if NETCOREAPP3_1 | ||
|
||
using Xunit; | ||
|
||
namespace McMaster.NETCore.Plugins.Tests | ||
{ | ||
public class ShadowCopyTests | ||
{ | ||
[Fact] | ||
public void DoesNotThrowWhenLoadingSameNativeDependecyMoreThanOnce() | ||
{ | ||
var samplePath = TestResources.GetTestProjectAssembly("NativeDependency"); | ||
|
||
using var loader = PluginLoader | ||
.CreateFromAssemblyFile(samplePath, config => config.EnableHotReload = true); | ||
|
||
var nativeDependecyLoadMethod = loader.LoadDefaultAssembly() | ||
.GetType("NativeDependency.NativeDependencyLoader") | ||
.GetMethod("Load"); | ||
|
||
var exception = Record.Exception(() => nativeDependecyLoadMethod.Invoke(null, null)); | ||
|
||
Assert.Null(exception); | ||
} | ||
} | ||
} | ||
|
||
#endif | ||
// Copyright (c) Nate McMaster. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
#if NETCOREAPP3_1 | ||
|
||
using Xunit; | ||
|
||
namespace McMaster.NETCore.Plugins.Tests | ||
{ | ||
public class ShadowCopyTests | ||
{ | ||
[Fact] | ||
public void DoesNotThrowWhenLoadingSameNativeDependecyMoreThanOnce() | ||
{ | ||
var samplePath = TestResources.GetTestProjectAssembly("NativeDependency"); | ||
|
||
using var loader = PluginLoader | ||
.CreateFromAssemblyFile(samplePath, config => config.EnableHotReload = true); | ||
|
||
var nativeDependecyLoadMethod = loader.LoadDefaultAssembly() | ||
?.GetType("NativeDependency.NativeDependencyLoader") | ||
?.GetMethod("Load"); | ||
|
||
var exception = Record.Exception(() => nativeDependecyLoadMethod?.Invoke(null, null)); | ||
|
||
Assert.Null(exception); | ||
} | ||
} | ||
} | ||
|
||
#endif |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// Copyright (c) Nate McMaster. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System; | ||
|
||
namespace NetCoreApp2App | ||
{ | ||
internal class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
Console.WriteLine(GetGreeting()); | ||
} | ||
|
||
public static string GetGreeting() => "Hello world!"; | ||
} | ||
} |
Oops, something went wrong.