public void ShouldTellMeAboutAnyClassDeclerationsWithinCode() { SetupCodeFile(@"public class Foo { } public class Bar { }"); var types = sourceExaminer.ExamineSource(codeFile); Assert.That(types.Count(), Is.EqualTo(2)); Assert.That(types.HasADeclerationCalled("Foo")); Assert.That(types.HasADeclerationCalled("Bar")); }
public ICodeFileInfo FromFile(FileInfo file) { var codeFile = new CodeFileInfo(file.Name, file.DirectoryName); var declerations = declerationInfoLoader.ExamineSource(codeFile); foreach (var decleration in declerations) { codeFile.AddDecleration(decleration); } return(codeFile); }