Example #1
0
        public void EnsureVariableNameIsNotReserved_AppendsTheAtSignOnCsharpKeywords()
        {
            //Arrange
            LanguageExpressions expressions = new CSharpExpressions();
            var keyword = "event";
            //Act
            var result = CommonGenerator.EnsureVariableNameIsNotReserved(keyword, expressions);

            //Assert
            Assert.Equal("@event", result);
        }
Example #2
0
        public void EnsureVariableNameIsNotReserved_DoesNotModifyVariableNamesIfNotReserved()
        {
            //Arrange
            LanguageExpressions expressions = new CSharpExpressions();
            var keyword = "people";
            //Act
            var result = CommonGenerator.EnsureVariableNameIsNotReserved(keyword, expressions);

            //Assert
            Assert.Equal("people", result);
        }
Example #3
0
        public void EnsureVariableNameIsNotReserved_AppendsUnderscoreOnJavascriptKeywords()
        {
            //Arrange
            LanguageExpressions expressions = new JavascriptExpressions();
            var keyword = "transient";
            //Act
            var result = CommonGenerator.EnsureVariableNameIsNotReserved(keyword, expressions);

            //Assert
            Assert.Equal("_transient", result);
        }