You've already forked linux-packaging-mono
Imported Upstream version 5.4.0.167
Former-commit-id: 5624ac747d633e885131e8349322922b6a59baaa
This commit is contained in:
parent
e49d6f06c0
commit
536cd135cc
@@ -1,10 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\dir.props" />
|
||||
<PropertyGroup>
|
||||
<AssemblyVersion>4.0.3.0</AssemblyVersion>
|
||||
<AssemblyKey>MSFT</AssemblyKey>
|
||||
<IsNETCoreApp>true</IsNETCoreApp>
|
||||
<IsUAP>true</IsUAP>
|
||||
<IsUAPRef>false</IsUAPRef>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
<GenFacadesIgnoreMissingTypes Condition="'$(TargetGroup)'=='uapaot'">true</GenFacadesIgnoreMissingTypes>
|
||||
<ProjectGuid>{8F05FFD6-6697-41CA-B733-709F5A6D3BF1}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<!-- Help VS understand available configurations -->
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Release|AnyCPU'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// 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.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -514,10 +515,10 @@ namespace System.Reflection.Emit.Tests
|
||||
[Fact]
|
||||
public static void NullConstructor_ThrowsArgumentNullException()
|
||||
{
|
||||
Assert.Throws<ArgumentNullException>("con", () => new CustomAttributeBuilder(null, new object[0]));
|
||||
Assert.Throws<ArgumentNullException>("con", () => new CustomAttributeBuilder(null, new object[0], new FieldInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentNullException>("con", () => new CustomAttributeBuilder(null, new object[0], new PropertyInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentNullException>("con", () => new CustomAttributeBuilder(null, new object[0], new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("con", () => new CustomAttributeBuilder(null, new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("con", () => new CustomAttributeBuilder(null, new object[0], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("con", () => new CustomAttributeBuilder(null, new object[0], new PropertyInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("con", () => new CustomAttributeBuilder(null, new object[0], new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -564,10 +565,10 @@ namespace System.Reflection.Emit.Tests
|
||||
{
|
||||
ConstructorInfo con = typeof(TestAttribute).GetConstructor(new Type[] { typeof(int) });
|
||||
|
||||
Assert.Throws<ArgumentNullException>("constructorArgs", () => new CustomAttributeBuilder(con, null));
|
||||
Assert.Throws<ArgumentNullException>("constructorArgs", () => new CustomAttributeBuilder(con, null, new FieldInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentNullException>("constructorArgs", () => new CustomAttributeBuilder(con, null, new PropertyInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentNullException>("constructorArgs", () => new CustomAttributeBuilder(con, null, new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("constructorArgs", () => new CustomAttributeBuilder(con, null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("constructorArgs", () => new CustomAttributeBuilder(con, null, new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("constructorArgs", () => new CustomAttributeBuilder(con, null, new PropertyInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("constructorArgs", () => new CustomAttributeBuilder(con, null, new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
public static IEnumerable<object[]> NotSupportedObject_Constructor_TestData()
|
||||
@@ -672,10 +673,10 @@ namespace System.Reflection.Emit.Tests
|
||||
ConstructorInfo con = typeof(TestAttribute).GetConstructor(new Type[] { typeof(int) });
|
||||
object[] constructorArgs = new object[] { null };
|
||||
|
||||
Assert.Throws<ArgumentNullException>("constructorArgs[0]", () => new CustomAttributeBuilder(con, constructorArgs));
|
||||
Assert.Throws<ArgumentNullException>("constructorArgs[0]", () => new CustomAttributeBuilder(con, constructorArgs, new FieldInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentNullException>("constructorArgs[0]", () => new CustomAttributeBuilder(con, constructorArgs, new PropertyInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentNullException>("constructorArgs[0]", () => new CustomAttributeBuilder(con, constructorArgs, new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("constructorArgs[0]", () => new CustomAttributeBuilder(con, constructorArgs));
|
||||
AssertExtensions.Throws<ArgumentNullException>("constructorArgs[0]", () => new CustomAttributeBuilder(con, constructorArgs, new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("constructorArgs[0]", () => new CustomAttributeBuilder(con, constructorArgs, new PropertyInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("constructorArgs[0]", () => new CustomAttributeBuilder(con, constructorArgs, new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
public static IEnumerable<object[]> NotSupportedPrimitives_TestData()
|
||||
@@ -692,10 +693,10 @@ namespace System.Reflection.Emit.Tests
|
||||
ConstructorInfo con = typeof(TestAttribute).GetConstructor(new Type[] { typeof(object) });
|
||||
object[] constructorArgs = new object[] { value };
|
||||
|
||||
Assert.Throws<ArgumentException>("constructorArgs[0]", () => new CustomAttributeBuilder(con, constructorArgs));
|
||||
Assert.Throws<ArgumentException>("constructorArgs[0]", () => new CustomAttributeBuilder(con, constructorArgs, new FieldInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentException>("constructorArgs[0]", () => new CustomAttributeBuilder(con, constructorArgs, new PropertyInfo[0], new object[0]));
|
||||
Assert.Throws<ArgumentException>("constructorArgs[0]", () => new CustomAttributeBuilder(con, constructorArgs, new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>("constructorArgs[0]", () => new CustomAttributeBuilder(con, constructorArgs));
|
||||
AssertExtensions.Throws<ArgumentException>("constructorArgs[0]", () => new CustomAttributeBuilder(con, constructorArgs, new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>("constructorArgs[0]", () => new CustomAttributeBuilder(con, constructorArgs, new PropertyInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>("constructorArgs[0]", () => new CustomAttributeBuilder(con, constructorArgs, new PropertyInfo[0], new object[0], new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -717,8 +718,8 @@ namespace System.Reflection.Emit.Tests
|
||||
{
|
||||
ConstructorInfo con = typeof(TestAttribute).GetConstructor(new Type[0]);
|
||||
|
||||
Assert.Throws<ArgumentNullException>("namedFields", () => new CustomAttributeBuilder(con, new object[0], (FieldInfo[])null, new object[0]));
|
||||
Assert.Throws<ArgumentNullException>("namedFields", () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], null, new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("namedFields", () => new CustomAttributeBuilder(con, new object[0], (FieldInfo[])null, new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("namedFields", () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], null, new object[0]));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -775,8 +776,8 @@ namespace System.Reflection.Emit.Tests
|
||||
{
|
||||
ConstructorInfo con = typeof(TestAttribute).GetConstructor(new Type[0]);
|
||||
|
||||
Assert.Throws<ArgumentNullException>("fieldValues", () => new CustomAttributeBuilder(con, new object[0], new FieldInfo[0], null));
|
||||
Assert.Throws<ArgumentNullException>("fieldValues", () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], new FieldInfo[0], null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("fieldValues", () => new CustomAttributeBuilder(con, new object[0], new FieldInfo[0], null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("fieldValues", () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], new FieldInfo[0], null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -785,8 +786,8 @@ namespace System.Reflection.Emit.Tests
|
||||
ConstructorInfo con = typeof(TestAttribute).GetConstructor(new Type[0]);
|
||||
FieldInfo[] namedFields = new FieldInfo[] { null };
|
||||
|
||||
Assert.Throws<ArgumentNullException>("namedFields[0]", () => new CustomAttributeBuilder(con, new object[0], namedFields, new object[1]));
|
||||
Assert.Throws<ArgumentNullException>("namedFields[0]", () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], namedFields, new object[1]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("namedFields[0]", () => new CustomAttributeBuilder(con, new object[0], namedFields, new object[1]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("namedFields[0]", () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], namedFields, new object[1]));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -796,8 +797,8 @@ namespace System.Reflection.Emit.Tests
|
||||
FieldInfo[] namedFields = Helpers.GetFields(typeof(TestAttribute), nameof(TestAttribute.TestInt));
|
||||
object[] fieldValues = new object[] { null };
|
||||
|
||||
Assert.Throws<ArgumentNullException>("fieldValues[0]", () => new CustomAttributeBuilder(con, new object[0], namedFields, fieldValues));
|
||||
Assert.Throws<ArgumentNullException>("fieldValues[0]", () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], namedFields, fieldValues));
|
||||
AssertExtensions.Throws<ArgumentNullException>("fieldValues[0]", () => new CustomAttributeBuilder(con, new object[0], namedFields, fieldValues));
|
||||
AssertExtensions.Throws<ArgumentNullException>("fieldValues[0]", () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new object[0], namedFields, fieldValues));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -841,8 +842,8 @@ namespace System.Reflection.Emit.Tests
|
||||
FieldInfo[] namedFields = Helpers.GetFields(typeof(TestAttribute), nameof(TestAttribute.ObjectField));
|
||||
object[] fieldValues = new object[] { value };
|
||||
|
||||
Assert.Throws<ArgumentException>("fieldValues[0]", () => new CustomAttributeBuilder(con, new object[0], namedFields, fieldValues));
|
||||
Assert.Throws<ArgumentException>("fieldValues[0]", () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new FieldInfo[0], namedFields, fieldValues));
|
||||
AssertExtensions.Throws<ArgumentException>("fieldValues[0]", () => new CustomAttributeBuilder(con, new object[0], namedFields, fieldValues));
|
||||
AssertExtensions.Throws<ArgumentException>("fieldValues[0]", () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], new FieldInfo[0], namedFields, fieldValues));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -879,8 +880,8 @@ namespace System.Reflection.Emit.Tests
|
||||
{
|
||||
ConstructorInfo con = typeof(TestAttribute).GetConstructor(new Type[0]);
|
||||
|
||||
Assert.Throws<ArgumentNullException>("namedProperties", () => new CustomAttributeBuilder(con, new object[0], (PropertyInfo[])null, new object[0]));
|
||||
Assert.Throws<ArgumentNullException>("namedProperties", () => new CustomAttributeBuilder(con, new object[0], null, new object[0], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("namedProperties", () => new CustomAttributeBuilder(con, new object[0], (PropertyInfo[])null, new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("namedProperties", () => new CustomAttributeBuilder(con, new object[0], null, new object[0], new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -888,8 +889,8 @@ namespace System.Reflection.Emit.Tests
|
||||
{
|
||||
ConstructorInfo con = typeof(TestAttribute).GetConstructor(new Type[0]);
|
||||
|
||||
Assert.Throws<ArgumentNullException>("propertyValues", () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], null));
|
||||
Assert.Throws<ArgumentNullException>("propertyValues", () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], null, new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("propertyValues", () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("propertyValues", () => new CustomAttributeBuilder(con, new object[0], new PropertyInfo[0], null, new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -898,8 +899,8 @@ namespace System.Reflection.Emit.Tests
|
||||
ConstructorInfo con = typeof(TestAttribute).GetConstructor(new Type[0]);
|
||||
PropertyInfo[] namedProperties = new PropertyInfo[] { null };
|
||||
|
||||
Assert.Throws<ArgumentNullException>("namedProperties[0]", () => new CustomAttributeBuilder(con, new object[0], namedProperties, new object[1]));
|
||||
Assert.Throws<ArgumentNullException>("namedProperties[0]", () => new CustomAttributeBuilder(con, new object[0], namedProperties, new object[1], new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("namedProperties[0]", () => new CustomAttributeBuilder(con, new object[0], namedProperties, new object[1]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("namedProperties[0]", () => new CustomAttributeBuilder(con, new object[0], namedProperties, new object[1], new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -958,8 +959,8 @@ namespace System.Reflection.Emit.Tests
|
||||
PropertyInfo[] namedProperties = Helpers.GetProperties(typeof(TestAttribute), nameof(TestAttribute.TestInt32));
|
||||
object[] propertyValues = new object[] { null };
|
||||
|
||||
Assert.Throws<ArgumentNullException>("propertyValues[0]", () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues));
|
||||
Assert.Throws<ArgumentNullException>("propertyValues[0]", () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues, new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("propertyValues[0]", () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues));
|
||||
AssertExtensions.Throws<ArgumentNullException>("propertyValues[0]", () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues, new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@@ -1000,8 +1001,8 @@ namespace System.Reflection.Emit.Tests
|
||||
PropertyInfo[] namedProperties = Helpers.GetProperties(typeof(TestAttribute), nameof(TestAttribute.ObjectProperty));
|
||||
object[] propertyValues = new object[] { value };
|
||||
|
||||
Assert.Throws<ArgumentException>("propertyValues[0]", () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues));
|
||||
Assert.Throws<ArgumentException>("propertyValues[0]", () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues, new FieldInfo[0], new object[0]));
|
||||
AssertExtensions.Throws<ArgumentException>("propertyValues[0]", () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues));
|
||||
AssertExtensions.Throws<ArgumentException>("propertyValues[0]", () => new CustomAttributeBuilder(con, new object[0], namedProperties, propertyValues, new FieldInfo[0], new object[0]));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -90,8 +90,8 @@ namespace System.Reflection.Emit.Tests
|
||||
ModuleBuilder module = Helpers.DynamicModule();
|
||||
MethodBuilder method = module.DefineGlobalMethod("Method", MethodAttributes.Public | MethodAttributes.Static, typeof(Type), new Type[0]);
|
||||
ILGenerator ilGenerator = method.GetILGenerator();
|
||||
Assert.Throws<ArgumentNullException>("localType", () => ilGenerator.DeclareLocal(null));
|
||||
Assert.Throws<ArgumentNullException>("localType", () => ilGenerator.DeclareLocal(null, false));
|
||||
AssertExtensions.Throws<ArgumentNullException>("localType", () => ilGenerator.DeclareLocal(null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("localType", () => ilGenerator.DeclareLocal(null, false));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -200,7 +200,7 @@ namespace System.Reflection.Emit.Tests
|
||||
MethodBuilder method = module.DefineGlobalMethod("Method", MethodAttributes.Public | MethodAttributes.Static, typeof(Type), new Type[0]);
|
||||
|
||||
ILGenerator ilGenerator = method.GetILGenerator();
|
||||
Assert.Throws<ArgumentNullException>("meth", () => ilGenerator.Emit(OpCodes.Call, (MethodInfo)null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("meth", () => ilGenerator.Emit(OpCodes.Call, (MethodInfo)null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace System.Reflection.Emit.Tests
|
||||
MethodBuilder method = type.DefineMethod("Method", MethodAttributes.Public | MethodAttributes.Static);
|
||||
ILGenerator generator = method.GetILGenerator();
|
||||
|
||||
Assert.Throws<ArgumentNullException>("local", () => generator.Emit(OpCodes.Ldarg_0, (LocalBuilder)null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("local", () => generator.Emit(OpCodes.Ldarg_0, (LocalBuilder)null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -155,7 +155,7 @@ namespace System.Reflection.Emit.Tests
|
||||
ILGenerator generator = method1.GetILGenerator();
|
||||
LocalBuilder local = method2.GetILGenerator().DeclareLocal(typeof(int));
|
||||
|
||||
Assert.Throws<ArgumentException>("local", () => generator.Emit(OpCodes.Ldarg_0, local));
|
||||
AssertExtensions.Throws<ArgumentException>("local", () => generator.Emit(OpCodes.Ldarg_0, local));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -219,7 +219,7 @@ namespace System.Reflection.Emit.Tests
|
||||
MethodBuilder method = type.DefineMethod("Method", MethodAttributes.Public | MethodAttributes.Static);
|
||||
ILGenerator generator = method.GetILGenerator();
|
||||
|
||||
Assert.Throws<ArgumentNullException>("local", () => generator.Emit(OpCodes.Ldloc_0, (LocalBuilder)null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("local", () => generator.Emit(OpCodes.Ldloc_0, (LocalBuilder)null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -231,7 +231,7 @@ namespace System.Reflection.Emit.Tests
|
||||
ILGenerator generator = method1.GetILGenerator();
|
||||
LocalBuilder local = method2.GetILGenerator().DeclareLocal(typeof(string));
|
||||
|
||||
Assert.Throws<ArgumentException>("local", () => generator.Emit(OpCodes.Ldloc_0, local));
|
||||
AssertExtensions.Throws<ArgumentException>("local", () => generator.Emit(OpCodes.Ldloc_0, local));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -65,9 +65,9 @@ namespace System.Reflection.Emit.Tests
|
||||
MethodBuilder method = type.DefineMethod("method1", MethodAttributes.Public | MethodAttributes.Static, typeof(void), new Type[] { typeof(int) });
|
||||
ParameterBuilder parameter = method.DefineParameter(1, ParameterAttributes.HasDefault, "testParam");
|
||||
|
||||
Assert.Throws<ArgumentNullException>("con", () => parameter.SetCustomAttribute(null, new byte[0]));
|
||||
Assert.Throws<ArgumentNullException>("binaryAttribute", () => parameter.SetCustomAttribute(typeof(ParameterBuilderCustomAttribute).GetConstructor(new Type[] { typeof(bool) }), null));
|
||||
Assert.Throws<ArgumentNullException>("customBuilder", () => parameter.SetCustomAttribute(null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("con", () => parameter.SetCustomAttribute(null, new byte[0]));
|
||||
AssertExtensions.Throws<ArgumentNullException>("binaryAttribute", () => parameter.SetCustomAttribute(typeof(ParameterBuilderCustomAttribute).GetConstructor(new Type[] { typeof(bool) }), null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("customBuilder", () => parameter.SetCustomAttribute(null));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,9 +50,9 @@ namespace System.Reflection.Emit.Tests
|
||||
ModuleBuilder module = Helpers.DynamicModule();
|
||||
SignatureHelper helper = SignatureHelper.GetFieldSigHelper(module);
|
||||
|
||||
Assert.Throws<ArgumentNullException>("argument", () => helper.AddArgument(null));
|
||||
Assert.Throws<ArgumentNullException>("argument", () => helper.AddArgument(null, true));
|
||||
Assert.Throws<ArgumentNullException>("argument", () => helper.AddArgument(null, null, null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("argument", () => helper.AddArgument(null));
|
||||
AssertExtensions.Throws<ArgumentNullException>("argument", () => helper.AddArgument(null, true));
|
||||
AssertExtensions.Throws<ArgumentNullException>("argument", () => helper.AddArgument(null, null, null));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace System.Reflection.Emit.Tests
|
||||
ModuleBuilder module = Helpers.DynamicModule();
|
||||
SignatureHelper helper = SignatureHelper.GetFieldSigHelper(module);
|
||||
|
||||
Assert.Throws<ArgumentNullException>("requiredCustomModifiers", () => { helper.AddArguments(new Type[] { typeof(string) }, new Type[][] { new Type[] { typeof(int), null } }, null); });
|
||||
AssertExtensions.Throws<ArgumentNullException>("requiredCustomModifiers", () => { helper.AddArguments(new Type[] { typeof(string) }, new Type[][] { new Type[] { typeof(int), null } }, null); });
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -62,10 +62,10 @@ namespace System.Reflection.Emit.Tests
|
||||
ModuleBuilder module = Helpers.DynamicModule();
|
||||
SignatureHelper helper = SignatureHelper.GetFieldSigHelper(module);
|
||||
|
||||
Assert.Throws<ArgumentException>("requiredCustomModifiers", () => helper.AddArguments(new Type[] { typeof(string) }, new Type[][] { new Type[] { typeof(int), typeof(int[]) } }, null));
|
||||
AssertExtensions.Throws<ArgumentException>("requiredCustomModifiers", () => helper.AddArguments(new Type[] { typeof(string) }, new Type[][] { new Type[] { typeof(int), typeof(int[]) } }, null));
|
||||
Assert.Throws<ArgumentException>(null, () => helper.AddArguments(new Type[] { typeof(string) }, new Type[][] { new Type[] { typeof(int) }, new Type[] { typeof(char) } }, null));
|
||||
|
||||
Assert.Throws<ArgumentException>("optionalCustomModifiers", () => helper.AddArguments(new Type[] { typeof(string) }, null, new Type[][] { new Type[] { typeof(int), typeof(int[]) } }));
|
||||
AssertExtensions.Throws<ArgumentException>("optionalCustomModifiers", () => helper.AddArguments(new Type[] { typeof(string) }, null, new Type[][] { new Type[] { typeof(int), typeof(int[]) } }));
|
||||
Assert.Throws<ArgumentException>(null, () => helper.AddArguments(new Type[] { typeof(string) }, null, new Type[][] { new Type[] { typeof(int) }, new Type[] { typeof(char) } }));
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace System.Reflection.Emit.Tests
|
||||
ModuleBuilder module = Helpers.DynamicModule();
|
||||
SignatureHelper helper = SignatureHelper.GetFieldSigHelper(module);
|
||||
|
||||
Assert.Throws<ArgumentNullException>("optionalCustomModifiers", () => helper.AddArguments(new Type[] { typeof(string) }, null, new Type[][] { new Type[] { typeof(int), null } }));
|
||||
AssertExtensions.Throws<ArgumentNullException>("optionalCustomModifiers", () => helper.AddArguments(new Type[] { typeof(string) }, null, new Type[][] { new Type[] { typeof(int), null } }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace System.Reflection.Emit.Tests
|
||||
public void GetMethodSigHelper_Module_Type_TypeArray_NullObjectInParameterType_ThrowsArgumentNullException()
|
||||
{
|
||||
ModuleBuilder module = Helpers.DynamicModule();
|
||||
Assert.Throws<ArgumentNullException>("argument", () => SignatureHelper.GetMethodSigHelper(module, typeof(string), new Type[] { typeof(char), null }));
|
||||
AssertExtensions.Throws<ArgumentNullException>("argument", () => SignatureHelper.GetMethodSigHelper(module, typeof(string), new Type[] { typeof(char), null }));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace System.Reflection.Emit.Tests
|
||||
{
|
||||
ModuleBuilder module = Helpers.DynamicModule();
|
||||
|
||||
Assert.Throws<ArgumentNullException>("argument", () => SignatureHelper.GetPropertySigHelper(module, typeof(string), new Type[] { null, typeof(int) }));
|
||||
AssertExtensions.Throws<ArgumentNullException>("argument", () => SignatureHelper.GetPropertySigHelper(module, typeof(string), new Type[] { null, typeof(int) }));
|
||||
}
|
||||
|
||||
public static IEnumerable<object[]> GetPropertySigHelper_TestData()
|
||||
@@ -69,7 +69,7 @@ namespace System.Reflection.Emit.Tests
|
||||
|
||||
ModuleBuilder module = Helpers.DynamicModule();
|
||||
|
||||
Assert.Throws<ArgumentNullException>("optionalCustomModifiers", () => SignatureHelper.GetPropertySigHelper(module, typeof(string), types, types, types, customModifiers, customModifiers));
|
||||
AssertExtensions.Throws<ArgumentNullException>("optionalCustomModifiers", () => SignatureHelper.GetPropertySigHelper(module, typeof(string), types, types, types, customModifiers, customModifiers));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
<Compile Include="SignatureHelper\SignatureHelperToString.cs" />
|
||||
<Compile Include="CustomAttributeBuilderTests.cs" />
|
||||
<Compile Include="Utilities.cs" />
|
||||
<Compile Include="$(CommonTestPath)\System\AssertExtensions.cs">
|
||||
<Link>Common\System\AssertExtensions.cs</Link>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
|
||||
</Project>
|
||||
Reference in New Issue
Block a user