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

AttributeProviderAttributeTests.cs « tests « System.ComponentModel.TypeConverter « src - github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 383a7be89ed346d8bef92cac4bcf2ca91e8d8fce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Xunit;

namespace System.ComponentModel.Tests
{
    public class AttributeProviderAttributeTests
    {
        [Fact]
        public static void GetPropertyName()
        {
            var typeName = "type";
            var propertyName = "property";
            var attribute = new AttributeProviderAttribute(typeName, propertyName);

            Assert.Equal(propertyName, attribute.PropertyName);
        }

        [Fact]
        public static void GetTypeName_SetByString()
        {
            var typeName = "type";
            var attribute = new AttributeProviderAttribute(typeName);

            Assert.Equal(typeName, attribute.TypeName);
        }

        [Fact]
        public static void GetTypeName_SetByType()
        {
            var type = typeof(AttributeProviderAttribute);
            var attribute = new AttributeProviderAttribute(type);

            Assert.Equal(type.AssemblyQualifiedName, attribute.TypeName);
        }
    }
}