A convention that sets the element name the same as the member name with the first character lower cased.
Наследование: ConventionBase, IMemberMapConvention, IElementNameConvention
 public void TestCamelCaseElementNameConvention() {
     var convention = new CamelCaseElementNameConvention();
     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 TestShouldDowncaseCertainNumberOfChars(int charsToDowncase, string expected)
        {
            var convention = new CamelCaseElementNameConvention(charsToDowncase);
            var classMap = new BsonClassMap<TestClass>();
            var ioStream = classMap.MapMember(x => x.ALLCAPS);

            convention.Apply(ioStream);

            Assert.AreEqual(expected, ioStream.ElementName);
        }
        public void TestShouldNotChangeIfAlreadyCamelCased()
        {
            var convention = new CamelCaseElementNameConvention();
            var classMap = new BsonClassMap<TestClass>();
            var lowerCase = classMap.MapMember(x => x.camelCasedName);

            convention.Apply(lowerCase);

            Assert.AreEqual("camelCasedName", lowerCase.ElementName);
        }
        public void TestShouldHandleNameStartingWithNonLetter()
        {
            var convention = new CamelCaseElementNameConvention();
            var classMap = new BsonClassMap<TestClass>();
            var _dumbName = classMap.MapMember(x => x._dumbName);

            convention.Apply(_dumbName);

            Assert.AreEqual("_dumbName", _dumbName.ElementName);
        }
        public void TestCamelCaseElementNameConvention()
        {
            var convention = new CamelCaseElementNameConvention();
#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 TestCamelCaseElementNameConvention()
 {
     var convention = new CamelCaseElementNameConvention();
     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 TestShouldDowncaseOnlyFirstCharByDefault()
        {
            var convention = new CamelCaseElementNameConvention();
            var classMap = new BsonClassMap<TestClass>();
            var firstName = classMap.MapMember(x => x.FirstName);
            var age = classMap.MapMember(x => x.Age);
            var allCaps = classMap.MapMember(x => x.ALLCAPS);

            convention.Apply(firstName);
            convention.Apply(age);
            convention.Apply(allCaps);

            Assert.AreEqual("firstName", firstName.ElementName);
            Assert.AreEqual("age", age.ElementName);
            Assert.AreEqual("aLLCAPS", allCaps.ElementName);
        }
        public void TestCamelCaseElementNameConvention()
        {
            var convention = new CamelCaseElementNameConvention();
            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.AreEqual("firstName", firstName.ElementName);
            Assert.AreEqual("age", age.ElementName);
            Assert.AreEqual("_DumbName", _dumbName.ElementName);
            Assert.AreEqual("lowerCase", lowerCase.ElementName);
        }