예제 #1
0
        public void Apply_WithThreeWordPropertyNameWithTitleCase_ReturnsCamlecaseAndHyphenSeparated()
        {
            string propertyName   = "ThreeWordsNow";
            string expectedResult = "three-Words-Now";

            var namingConvention = new CamelDashNameConvention();

            var result = namingConvention.Apply(propertyName);

            Assert.Equal(expected: expectedResult, actual: result);
        }
예제 #2
0
        public void Apply_WithOneWordPropertyNameInAllLowerCase_ReturnsAllLowerCasePropertyName()
        {
            string propertyName   = "lower";
            string expectedResult = "lower";

            var namingConvention = new CamelDashNameConvention();

            var result = namingConvention.Apply(propertyName);

            Assert.Equal(expected: expectedResult, actual: result);
        }
예제 #3
0
        public void Apply_WithOneWordPropertyNameWithAllLettersCapitalised_ReturnsAllLowerCasePropertyName()
        {
            string propertyName   = "SKU";
            string expectedResult = "sku";

            var namingConvention = new CamelDashNameConvention();

            var result = namingConvention.Apply(propertyName);

            Assert.Equal(expected: expectedResult, actual: result);
        }
예제 #4
0
        public void ApplyingNaming_WithEmptyPropertyNameProvided_ThrowsException()
        {
            string propertyName = string.Empty;

            var namingConvention = new CamelDashNameConvention();

            Assert.Throws <ArgumentException>(() =>
            {
                namingConvention.Apply(propertyName);
            });
        }