Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void IsSecurityTransparent_ReturnsValue()
Assert.False(value);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataTokenSupported))]
public void MetadataToken_ReturnsValue()
{
Assert.True(_customConstructor.MetadataToken > 0);
Expand Down Expand Up @@ -148,7 +148,7 @@ public void GetGenericArguments_ThrowsNotSupported()
Assert.Throws<NotSupportedException>(() => _customConstructor.GetGenericArguments());
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMethodBodySupported))]
public void GetMethodBody_ReturnsBody()
{
MethodBody body = _customConstructor.GetMethodBody();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void IsMulticast_ReturnsTrue()
Assert.True(_customEvent.IsMulticast);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataTokenSupported))]
public void MetadataToken_ReturnsPositiveValue()
{
int token = _customEvent.MetadataToken;
Expand Down Expand Up @@ -109,7 +109,7 @@ public void GetRaiseMethod_ReturnsNull()
Assert.Null(raiseMethod);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot))]
[ActiveIssue("https://github.com/mono/mono/issues/15191", TestRuntimes.Mono)]
public void GetOtherMethods_ReturnsEmpty()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void IsSecurityTransparent_ReturnsValue()
Assert.False(value);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataTokenSupported))]
public void MetadataToken_ReturnsValue()
{
Assert.True(_customMethod.MetadataToken > 0);
Expand Down Expand Up @@ -179,7 +179,7 @@ public void GetGenericArguments_ReturnsProjectedTypes()
Assert.Empty(args);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMethodBodySupported))]
public void GetMethodBody_ReturnsBodyWithLocals()
{
MethodBody body = _customMethod.GetMethodBody();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void FullyQualifiedName_ContainsTestAssemblyName()
Assert.EndsWith(".dll", fqn);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataTokenSupported))]
public void MetadataToken_ReturnsValue()
{
int token = _customModule.MetadataToken;
Expand Down Expand Up @@ -174,13 +174,13 @@ public void FindTypes_ReturnsProjectedTypes()
Assert.NotEmpty(types);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot))]
public void IsResource_ReturnsFalse()
{
Assert.False(_customModule.IsResource());
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataTokenSupported))]
public void ResolveField_ReturnsProjectedField()
{
FieldInfo originalField = typeof(SecondTestObject).GetField("field");
Expand All @@ -189,7 +189,7 @@ public void ResolveField_ReturnsProjectedField()
Assert.NotNull(resolvedField);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataTokenSupported))]
public void ResolveMethod_ReturnsProjectedMethod()
{
MethodInfo originalMethod = typeof(TestObject).GetMethod("GetMessage");
Expand All @@ -198,7 +198,7 @@ public void ResolveMethod_ReturnsProjectedMethod()
Assert.NotNull(resolvedMethod);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataTokenSupported))]
public void ResolveType_ReturnsProjectedType()
{
int token = typeof(TestObject).MetadataToken;
Expand All @@ -207,7 +207,7 @@ public void ResolveType_ReturnsProjectedType()
Assert.Equal(ProjectionConstants.CustomType, resolvedType.GetType().FullName);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataTokenSupported))]
public void ResolveMember_ReturnsProjectedMember()
{
MethodInfo originalMethod = typeof(TestObject).GetMethod("GetMessage");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void Member_ReturnsProjectedMember()
Assert.NotNull(member);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataTokenSupported))]
public void MetadataToken_ReturnsValue()
{
int token = _requiredParameter.MetadataToken;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void IsSerializable_ReturnsValue()
}
#pragma warning restore SYSLIB0050

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataTokenSupported))]
public void MetadataToken_ReturnsValue()
{
Assert.True(_customTypeInfo.MetadataToken > 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public void GetName_WithCopiedName_ReturnsValue()
Assert.NotNull(name);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot))]
public void GetReferencedAssemblies_ReturnsValue()
Comment thread
MichalStrehovsky marked this conversation as resolved.
Outdated
{
AssemblyName[] refs = _customAssembly.GetReferencedAssemblies();
Expand Down Expand Up @@ -245,7 +245,7 @@ public void MadeGenericMethod_ContainsGenericParameters_ReturnsFalse()
Assert.False(concreteMethod.ContainsGenericParameters);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot))]
public void Invoke_OnMadeGenericMethod_Works()
Comment thread
MichalStrehovsky marked this conversation as resolved.
{
MethodInfo concreteMethod = _genericMethod.MakeGenericMethod(typeof(int));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public void GetManifestResourceStream_WithType_ReturnsStream()
// May be null if resource doesn't exist
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.HasAssemblyFiles))]
public void GetModule_ReturnsModule()
Comment thread
MichalStrehovsky marked this conversation as resolved.
Outdated
{
Module module = _customAssembly.GetModule(_customAssembly.ManifestModule.Name);
Expand Down Expand Up @@ -147,7 +147,7 @@ public void GetType_ReturnsNull_ForNonExistent()
Assert.Null(type);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot))]
public void GetSatelliteAssembly_ThrowsForNonExistent()
Comment thread
MichalStrehovsky marked this conversation as resolved.
Outdated
{
Assert.Throws<FileNotFoundException>(() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public void IsStatic_ReturnsTrue_ForStatic()
Assert.False(_publicField.IsStatic);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataTokenSupported))]
public void MetadataToken_ReturnsValue()
{
Assert.True(_publicField.MetadataToken > 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void IsSpecialName_ReturnsFalse()
Assert.False(_readWriteProperty.IsSpecialName);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMetadataTokenSupported))]
public void MetadataToken_ReturnsValue()
{
Assert.True(_readWriteProperty.MetadataToken > 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void GetEnumNames_ReturnsNames()
Assert.Contains("Value2", names);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot))]
public void GetEnumValues_ReturnsValues()
{
TypeInfo enumTypeInfo = typeof(TestEnum).GetTypeInfo();
Expand Down Expand Up @@ -208,7 +208,7 @@ public void InvokeMember_InvokesMethod()
Assert.Equal("test", result);
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot))]
Comment thread
MichalStrehovsky marked this conversation as resolved.
Outdated
public void GetInterfaceMap_ReturnsProjectedMapping()
{
TypeInfo listTypeInfo = typeof(List<int>).GetTypeInfo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void InvokeMember_SetProperty_SetsValue()
}

// Test GetInterfaceMap
[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotNativeAot))]
Comment thread
MichalStrehovsky marked this conversation as resolved.
Outdated
public void GetInterfaceMap_ReturnsMapping()
{
TypeInfo listType = _customReflectionContext.MapType(typeof(List<int>).GetTypeInfo());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void Module_GetField_WithBindingFlags_ReturnsValue()
}

// Tests for projecting constructor
[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMethodBodySupported))]
public void Constructor_GetMethodBody_LocalVariables_ReturnsProjectedLocals()
{
TypeInfo typeInfo = typeof(TestObject).GetTypeInfo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ public void MethodWithFilter()
}
}

[Fact]
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsMethodBodySupported))]
public void ExceptionHandlingClause_WithFilter_HasFilterOffset()
{
TypeInfo typeInfo = typeof(TypeWithFilter).GetTypeInfo();
Expand Down
Loading
Loading