Beispiel #1
0
        private void CriticizeInternal()
        {
            // Read file and create rule context
            var sourceCodePath = SettingsBuilder.RulePath;
            var sourceCode = TryReadSourceCode(sourceCodePath);

            if (sourceCode != null)
            {
                var ruleContext = new RuleContext(sourceCode);

                // Evaluate the code with skeptic
                Critic critic = TryCreateCritic(ruleContext);
                if (critic != null)
                {
                    critic.Criticize();

                    // Output the result
                    var skepticWriter = new SkepticWriter(critic, System.Console.Out);
                    skepticWriter.Write();
                }
            }
            else // The file was not found
            {
                "Cannot load file to evaluate".ConsoleWriteLine();
            }
        }
Beispiel #2
0
        private void CriticizeInternal()
        {
            // Read file and create rule context
            var sourceCodePath = SettingsBuilder.RulePath;
            var sourceCode     = TryReadSourceCode(sourceCodePath);

            if (sourceCode != null)
            {
                var ruleContext = new RuleContext(sourceCode);

                // Evaluate the code with skeptic
                Critic critic = TryCreateCritic(ruleContext);
                if (critic != null)
                {
                    critic.Criticize();

                    // Output the result
                    var skepticWriter = new SkepticWriter(critic, System.Console.Out);
                    skepticWriter.Write();
                }
            }
            else // The file was not found
            {
                "Cannot load file to evaluate".ConsoleWriteLine();
            }
        }