1 // -----------------------------------------------------------------------
\r
2 // Copyright (c) Microsoft Corporation. All rights reserved.
\r
3 // -----------------------------------------------------------------------
\r
5 using System.ComponentModel.Composition.ReflectionModel;
\r
6 using System.UnitTesting;
\r
7 using Microsoft.VisualStudio.TestTools.UnitTesting;
\r
9 namespace System.UnitTesting
\r
11 internal static class ReflectionItemAssert
\r
13 public static void AreSame(ReflectionItem expected, ReflectionItem actual)
\r
15 switch (expected.ItemType)
\r
17 case ReflectionItemType.Property:
\r
19 ReflectionProperty expectedProperty = (ReflectionProperty)expected;
\r
20 ReflectionProperty actualProperty = (ReflectionProperty)actual;
\r
22 ReflectionAssert.AreSame(expectedProperty.UnderlyingGetMethod, actualProperty.UnderlyingGetMethod);
\r
23 ReflectionAssert.AreSame(expectedProperty.UnderlyingSetMethod, actualProperty.UnderlyingSetMethod);
\r
27 case ReflectionItemType.Parameter:
\r
29 ReflectionParameter expectedParameter = (ReflectionParameter)expected;
\r
30 ReflectionParameter actualParameter = (ReflectionParameter)actual;
\r
32 ReflectionAssert.AreSame(expectedParameter.UnderlyingParameter, actualParameter.UnderlyingParameter);
\r
38 ReflectionMember expectedMember = (ReflectionMember)expected;
\r
39 ReflectionMember actualMember = (ReflectionMember)actual;
\r
41 ReflectionAssert.AreSame(expectedMember.UnderlyingMember, actualMember.UnderlyingMember);
\r