A convention that allows you to set the Enum serialization representation
상속: ConventionBase, IMemberMapConvention
 public void TestConventionOverride()
 {
     var int64Convention = new EnumRepresentationConvention(BsonType.Int64);
     var strConvention = new EnumRepresentationConvention(BsonType.String);
     var classMap = new BsonClassMap<TestClass>();
     var memberMap = classMap.MapMember(x => x.ChangedRepresentationEnum);
     int64Convention.Apply(memberMap);
     strConvention.Apply(memberMap);
     Assert.AreEqual(BsonType.String, ((IRepresentationConfigurable)(memberMap.GetSerializer())).Representation);
 }
 public void TestConvention(BsonType value)
 {
     var convention = new EnumRepresentationConvention(value);
     var classMap = new BsonClassMap<TestClass>();
     var nonEnumMemberMap = classMap.MapMember(x => x.NonEnum);
     var defaultEnumMemberMap = classMap.MapMember(x => x.DefaultEnum);
     var changedEnumMemberMap = classMap.MapMember(x => x.ChangedRepresentationEnum);
     convention.Apply(nonEnumMemberMap);
     convention.Apply(changedEnumMemberMap);
     Assert.AreEqual(value, ((IRepresentationConfigurable)(changedEnumMemberMap.GetSerializer())).Representation);
 }
 public void TestConvention(BsonType value)
 {
     var convention = new EnumRepresentationConvention(value);
     var classMap = new BsonClassMap<TestClass>();
     var nonEnumMemberMap = classMap.MapMember(x => x.NonEnum);
     var defaultEnumMemberMap = classMap.MapMember(x => x.DefaultEnum);
     var changedEnumMemberMap = classMap.MapMember(x => x.ChangedRepresentationEnum);
     convention.Apply(nonEnumMemberMap);
     convention.Apply(changedEnumMemberMap);
     Assert.IsNull(nonEnumMemberMap.SerializationOptions);
     Assert.IsNull(defaultEnumMemberMap.SerializationOptions);
     Assert.AreEqual(value, ((RepresentationSerializationOptions)changedEnumMemberMap.SerializationOptions).Representation);
 }