コード例 #1
0
        public void GetCustomAttributeData()
        {
            var customAttributes   = new[] { CustomAttributeDeclarationObjectMother.Create() };
            var field              = CustomFieldInfoObjectMother.Create(customAttributes: customAttributes);
            var fieldInstantiation = new FieldOnTypeInstantiation(_declaringType, field);

            Assert.That(fieldInstantiation.GetCustomAttributeData(), Is.EqualTo(customAttributes));
        }
コード例 #2
0
        public void Initialization()
        {
            var field = CustomFieldInfoObjectMother.Create(type: _typeParameter);

            var result = new FieldOnTypeInstantiation(_declaringType, field);

            Assert.That(result.DeclaringType, Is.SameAs(_declaringType));
            Assert.That(result.Name, Is.EqualTo(field.Name));
            Assert.That(result.Attributes, Is.EqualTo(field.Attributes));
            Assert.That(result.FieldType, Is.SameAs(_typeArgument));
            Assert.That(result.FieldOnGenericType, Is.SameAs(field));
        }