Welcome to mirror list, hosted at ThFree Co, Russian Federation.

TypeExtensions.cs « System « UnitTestFramework « Tests « System.ComponentModel.Composition « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 55d0fb1b22b6665e549bffc2c779a5fed6e181d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// -----------------------------------------------------------------------
// Copyright (c) Microsoft Corporation.  All rights reserved.
// -----------------------------------------------------------------------
using System;
using System.Linq;
using System.Reflection;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace System
{
    public static class TypeExtensions
    {
        public static MemberInfo GetSingleMember(this Type type, string name)
        {
            Assert.IsNotNull(type);
            Assert.IsNotNull(name);

            return type.GetMember(name).Single();
        }
    }
}