コード例 #1
0
        public static void ColumnToPropertyName_GivenNullOrWhiteSpaceColumnName_ThrowsArgumentNullException(string columnName)
        {
            const string className      = "test";
            var          nameTranslator = new PascalCaseNameTranslator();

            Assert.That(() => nameTranslator.ColumnToPropertyName(className, columnName), Throws.ArgumentNullException);
        }
コード例 #2
0
        public static void ColumnToPropertyName_GivenTransformedNameMatchingClassName_ReturnsUnderscoreAppendedColumnName()
        {
            var nameTranslator = new PascalCaseNameTranslator();

            const string className = "FirstSecond";
            const string testName  = "FirstSecond";
            const string expected  = "FirstSecond_";

            var result = nameTranslator.ColumnToPropertyName(className, testName);

            Assert.That(result, Is.EqualTo(expected));
        }
コード例 #3
0
        public static void ColumnToPropertyName_GivenCamelCasedSchemaName_ReturnsPascalCasedText()
        {
            var nameTranslator = new PascalCaseNameTranslator();

            const string className = "test";
            const string testName  = "FirstSecond";
            const string expected  = "FirstSecond";

            var result = nameTranslator.ColumnToPropertyName(className, testName);

            Assert.That(result, Is.EqualTo(expected));
        }