A convention that sets the element name the same as the member name.
Inheritance: ConventionBase, IMemberMapConvention, IElementNameConvention
 public void TestMemberNameElementNameConvention() {
     var convention = new MemberNameElementNameConvention();
     Assert.AreEqual("FirstName", convention.GetElementName(typeof(TestClass).GetProperty("FirstName")));
     Assert.AreEqual("Age", convention.GetElementName(typeof(TestClass).GetProperty("Age")));
     Assert.AreEqual("_DumbName", convention.GetElementName(typeof(TestClass).GetProperty("_DumbName")));
     Assert.AreEqual("lowerCase", convention.GetElementName(typeof(TestClass).GetProperty("lowerCase")));
 }
        public void TestMemberNameElementNameConvention()
        {
            var convention = new MemberNameElementNameConvention();
#pragma warning disable 618
            Assert.AreEqual("FirstName", convention.GetElementName(typeof(TestClass).GetProperty("FirstName")));
            Assert.AreEqual("Age", convention.GetElementName(typeof(TestClass).GetProperty("Age")));
            Assert.AreEqual("_dumbName", convention.GetElementName(typeof(TestClass).GetProperty("_dumbName")));
            Assert.AreEqual("lowerCase", convention.GetElementName(typeof(TestClass).GetProperty("lowerCase")));
#pragma warning restore 618
        }
 public void TestMemberNameElementNameConvention()
 {
     var convention = new MemberNameElementNameConvention();
     var classMap = new BsonClassMap<TestClass>();
     convention.Apply(classMap.MapMember(x => x.FirstName));
     convention.Apply(classMap.MapMember(x => x.Age));
     convention.Apply(classMap.MapMember(x => x._DumbName));
     convention.Apply(classMap.MapMember(x => x.lowerCase));
     Assert.AreEqual("FirstName", classMap.GetMemberMap(x => x.FirstName).ElementName);
     Assert.AreEqual("Age", classMap.GetMemberMap(x => x.Age).ElementName);
     Assert.AreEqual("_DumbName", classMap.GetMemberMap(x => x._DumbName).ElementName);
     Assert.AreEqual("lowerCase", classMap.GetMemberMap(x => x.lowerCase).ElementName);
 }
        public void TestMemberNameElementNameConvention()
        {
            var convention = new MemberNameElementNameConvention();
            var classMap = new BsonClassMap<TestClass>();
            var firstName = classMap.MapMember(x => x.FirstName);
            var age = classMap.MapMember(x => x.Age);
            var _dumbName = classMap.MapMember(x => x._DumbName);
            var lowerCase = classMap.MapMember(x => x.lowerCase);

            convention.Apply(firstName);
            convention.Apply(age);
            convention.Apply(_dumbName);
            convention.Apply(lowerCase);

            Assert.Equal("FirstName", firstName.ElementName);
            Assert.Equal("Age", age.ElementName);
            Assert.Equal("_DumbName", _dumbName.ElementName);
            Assert.Equal("lowerCase", lowerCase.ElementName);
        }