public void Attributes_NonSerialized() { Assert.That(_field.IsNotSerialized, Is.False); _field.AddCustomAttribute(CustomAttributeDeclarationObjectMother.Create(typeof(NonSerializedAttribute))); Assert.That(_field.IsNotSerialized, Is.True); }
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); }
public static void ModifyField(MutableFieldInfo mutableField) { mutableField.AddCustomAttribute(CustomAttributeDeclarationObjectMother.Create()); }