public async Task WhenFieldIsReadThenDoesNotReturnError(string code)
{
var solution = CreateSolution(code);
var classDeclaration = (from p in solution.Projects
from d in p.Documents
let model = d.GetSemanticModelAsync().Result
let root = d.GetSyntaxRootAsync().Result
from n in root.DescendantNodes().OfType<FieldDeclarationSyntax>()
select new
{
semanticModel = model,
node = n
}).First();
var result = await _rule.Evaluate(classDeclaration.node, classDeclaration.semanticModel, solution);
Assert.Null(result);
}
}