示例#1
0
        public void Attributes_NonSerialized()
        {
            Assert.That(_field.IsNotSerialized, Is.False);

            _field.AddCustomAttribute(CustomAttributeDeclarationObjectMother.Create(typeof(NonSerializedAttribute)));

            Assert.That(_field.IsNotSerialized, Is.True);
        }
示例#2
0
        private IMutableMember CreateMutableInfo(params CustomAttributeDeclaration[] customAttributes)
        {
            var member = new MutableFieldInfo(MutableTypeObjectMother.Create(GetType()), "member", typeof(int), FieldAttributes.Private);

            foreach (var customAttriubte in customAttributes)
            {
                member.AddCustomAttribute(customAttriubte);
            }

            return(member);
        }
示例#3
0
 public static void ModifyField(MutableFieldInfo mutableField)
 {
     mutableField.AddCustomAttribute(CustomAttributeDeclarationObjectMother.Create());
 }