forked from dotnet/corefx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split netcoreapp code to its own files
- Loading branch information
Showing
10 changed files
with
258 additions
and
219 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Xunit; | ||
|
||
namespace System.Tests | ||
{ | ||
public static class Array17NetcoreappTests | ||
{ | ||
[Fact] | ||
public static void CreateInstance_Type_Int_Invalid() | ||
{ | ||
// Type is not a valid RuntimeType | ||
Assert.Throws<ArgumentException>("elementType", () => Array.CreateInstance(Helpers.NonRuntimeType(), 0)); | ||
} | ||
|
||
[Fact] | ||
public static void CreateInstance_Type_Int_Int_Invalid() | ||
{ | ||
// Type is not a valid RuntimeType | ||
Assert.Throws<ArgumentException>("elementType", () => Array.CreateInstance(Helpers.NonRuntimeType(), 0, 1)); | ||
} | ||
|
||
[Fact] | ||
public static void CreateInstance_Type_Int_Int_Int_Invalid() | ||
{ | ||
// Type is not a valid RuntimeType | ||
Assert.Throws<ArgumentException>("elementType", () => Array.CreateInstance(Helpers.NonRuntimeType(), 0, 1, 2)); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Globalization; | ||
using System.Reflection; | ||
using System.Reflection.Emit; | ||
|
||
namespace System.Tests | ||
{ | ||
public static partial class Helpers | ||
{ | ||
private static Type s_nonRuntimeType; | ||
|
||
public static Type NonRuntimeType() | ||
{ | ||
if (s_nonRuntimeType == null) | ||
{ | ||
AssemblyName assemblyName = new AssemblyName("AssemblyName"); | ||
AssemblyBuilder assemblyBuilder = AssemblyBuilder.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run); | ||
ModuleBuilder mboduleBuilder = assemblyBuilder.DefineDynamicModule(assemblyName.Name); | ||
|
||
TypeBuilder typeBuilder = mboduleBuilder.DefineType("TestType", TypeAttributes.Public); | ||
|
||
GenericTypeParameterBuilder[] typeParams = typeBuilder.DefineGenericParameters("T"); | ||
s_nonRuntimeType = typeParams[0].UnderlyingSystemType; | ||
} | ||
|
||
return s_nonRuntimeType; | ||
} | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
src/System.Runtime/tests/System/ActivatorTests.netcoreapp.cs
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,19 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using System.Reflection; | ||
using Xunit; | ||
|
||
namespace System.Tests | ||
{ | ||
public static class ActivatorNetcoreTests | ||
{ | ||
[Fact] | ||
public static void CreateInstance_Invalid() | ||
{ | ||
// Type is not a valid RuntimeType | ||
Assert.Throws<ArgumentException>("type", () => Activator.CreateInstance(Helpers.NonRuntimeType())); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.