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.
Initial commit of System.Reflection.Emit.Lightweight
- Loading branch information
1 parent
360607a
commit ce7a16e
Showing
25 changed files
with
2,625 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/System.Reflection.Emit.Lightweight/System.Reflection.Emit.Lightweight.sln
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,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.22609.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Reflection.Emit.Lightweight.Tests", "tests\System.Reflection.Emit.Lightweight.Tests.csproj", "{C338DCF7-FB75-407B-A2ED-117FBF3AAA18}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{C338DCF7-FB75-407B-A2ED-117FBF3AAA18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{C338DCF7-FB75-407B-A2ED-117FBF3AAA18}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{C338DCF7-FB75-407B-A2ED-117FBF3AAA18}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{C338DCF7-FB75-407B-A2ED-117FBF3AAA18}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
44 changes: 44 additions & 0 deletions
44
src/System.Reflection.Emit.Lightweight/tests/DynamicMethodAttributes.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,44 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using Xunit; | ||
|
||
namespace System.Reflection.Emit.Lightweight.Tests | ||
{ | ||
public class DynamicMethodAttributesTests | ||
{ | ||
public const string c_DYNAMICMETHODNAME = "MethodName"; | ||
|
||
[Fact] | ||
public void PosTest1() | ||
{ | ||
DynamicMethod dynamicmethod = new DynamicMethod(c_DYNAMICMETHODNAME, MethodAttributes.Static | MethodAttributes.Public, CallingConventions.Standard, null, null, typeof(TestClass).GetTypeInfo().Module, true); | ||
MethodAttributes methodattribute = dynamicmethod.Attributes; | ||
Assert.False(methodattribute != (MethodAttributes.Public | MethodAttributes.Static)); | ||
} | ||
|
||
[Fact] | ||
public void PosTest2() | ||
{ | ||
DynamicMethod dynamicmethod = new DynamicMethod(c_DYNAMICMETHODNAME, MethodAttributes.Static | MethodAttributes.Family | MethodAttributes.FamANDAssem, CallingConventions.Standard, null, null, typeof(TestClass).GetTypeInfo().Module, true); | ||
MethodAttributes methodattribute = dynamicmethod.Attributes; | ||
Assert.False(methodattribute != (MethodAttributes.Public | MethodAttributes.Static)); | ||
} | ||
} | ||
|
||
public class TestClass | ||
{ | ||
} | ||
|
||
public class GenClass1<T> | ||
{ | ||
} | ||
|
||
public class GenClass2<T, K> | ||
{ | ||
} | ||
|
||
public interface TestInter | ||
{ | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/System.Reflection.Emit.Lightweight/tests/DynamicMethodCallingConvention.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,23 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System; | ||
using System.Reflection; | ||
using System.Reflection.Emit; | ||
using Xunit; | ||
|
||
namespace System.Reflection.Emit.Lightweight.Tests | ||
{ | ||
public class DynamicMethodCallingConventionTests | ||
{ | ||
public const string c_DYNAMICMETHODNAME = "MethodName"; | ||
|
||
[Fact] | ||
public void PosTest1() | ||
{ | ||
DynamicMethod dynamicmethod = new DynamicMethod(c_DYNAMICMETHODNAME, MethodAttributes.Static | MethodAttributes.Public, CallingConventions.Standard, null, null, typeof(TestClass).GetTypeInfo().Module, true); | ||
CallingConventions callingconvertion = dynamicmethod.CallingConvention; | ||
Assert.False(callingconvertion != CallingConventions.Standard); | ||
} | ||
} | ||
} |
Oops, something went wrong.