public void CodeHasEffort(string code)
		{
			var metrics = new SyntaxMetricsCalculator().Calculate(code);

			var effort = metrics.Sum(m => m.GetEffort().TotalSeconds * 18);
			Assert.Greater(effort, 0);
		}
        public static void AnalyzeMethod(SymbolAnalysisContext context)
        {
            var namedTypeSymbol = (IMethodSymbol)context.Symbol;

            var syntax = context.Symbol.DeclaringSyntaxReferences.First().SyntaxTree.ToString(); //Careful, partial methods might burn you

            var calculator = new SyntaxMetricsCalculator();
            var result = calculator.Calculate(syntax);
        }
		public void CanGetHalsteadMetricsForMethodSnippet()
		{
			const string Code = @"public string GetValue() { return ""x""; }";
			var root = CSharpSyntaxTree.ParseText(Code).GetRoot();

			var metrics = new SyntaxMetricsCalculator().Calculate(root);

			Assert.NotNull(metrics);
		}
		public void CanGetHalsteadMetricsForMultipleArbitrarySnippets()
		{
			const string Code = @"var a = ""x""; return a;";
			var root = CSharpSyntaxTree.ParseText(Code).GetRoot();

			var metrics = new SyntaxMetricsCalculator().Calculate(root);

			Assert.NotNull(metrics);
		}
		public void CanGetHalsteadMetricsForClassSnippet()
		{
			const string Code = @"public class Something { 
public int Number { get{ return a - b; } }
public string GetValue() { return ""x"" + a; } 
}";
			var root = CSharpSyntaxTree.ParseText(Code).GetRoot();

			var metrics = new SyntaxMetricsCalculator().Calculate(root);

			Assert.NotNull(metrics);
		}