Example #1
0
        public void CheckMethodPageLifecycleHook_Returns_Null_For_Incorrect_Params()
        {
            var methodDeclaration = SyntaxFactory
                                    .MethodDeclaration(
                SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.VoidKeyword)),
                SyntaxFactory.Identifier(InitMethodName));

            var result = LifecycleManagerService.CheckMethodPageLifecycleHook(methodDeclaration);

            Assert.IsNull(result);
        }
Example #2
0
        public void CheckMethodPageLifecycleHook_Returns_Null_For_Incorrect_Name()
        {
            var methodDeclaration = SyntaxFactory
                                    .MethodDeclaration(
                SyntaxFactory.PredefinedType(SyntaxFactory.Token(SyntaxKind.VoidKeyword)),
                SyntaxFactory.Identifier(IncorrectMethodName))
                                    .AddParameterListParameters(
                SyntaxFactory.Parameter(SyntaxFactory.Identifier(SenderParamName)).WithType(SyntaxFactory.ParseTypeName(SenderParamType)),
                SyntaxFactory.Parameter(SyntaxFactory.Identifier(EventArgsParamName)).WithType(SyntaxFactory.ParseTypeName(EventArgsParamType)));

            var result = LifecycleManagerService.CheckMethodPageLifecycleHook(methodDeclaration);

            Assert.IsNull(result);
        }