mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-16 17:10:20 -10:00
48 lines
1.9 KiB
C#
48 lines
1.9 KiB
C#
// -----------------------------------------------------------------------
|
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// -----------------------------------------------------------------------
|
|
using System;
|
|
using System.ComponentModel.Composition.ReflectionModel;
|
|
using System.UnitTesting;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
namespace System.UnitTesting
|
|
{
|
|
internal static class ReflectionItemAssert
|
|
{
|
|
public static void AreSame(ReflectionItem expected, ReflectionItem actual)
|
|
{
|
|
switch (expected.ItemType)
|
|
{
|
|
case ReflectionItemType.Property:
|
|
{
|
|
ReflectionProperty expectedProperty = (ReflectionProperty)expected;
|
|
ReflectionProperty actualProperty = (ReflectionProperty)actual;
|
|
|
|
ReflectionAssert.AreSame(expectedProperty.UnderlyingGetMethod, actualProperty.UnderlyingGetMethod);
|
|
ReflectionAssert.AreSame(expectedProperty.UnderlyingSetMethod, actualProperty.UnderlyingSetMethod);
|
|
return;
|
|
}
|
|
|
|
case ReflectionItemType.Parameter:
|
|
{
|
|
ReflectionParameter expectedParameter = (ReflectionParameter)expected;
|
|
ReflectionParameter actualParameter = (ReflectionParameter)actual;
|
|
|
|
ReflectionAssert.AreSame(expectedParameter.UnderlyingParameter, actualParameter.UnderlyingParameter);
|
|
return;
|
|
}
|
|
|
|
default:
|
|
{
|
|
ReflectionMember expectedMember = (ReflectionMember)expected;
|
|
ReflectionMember actualMember = (ReflectionMember)actual;
|
|
|
|
ReflectionAssert.AreSame(expectedMember.UnderlyingMember, actualMember.UnderlyingMember);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|