Beispiel #1
0
        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"));
        }
Beispiel #2
0
        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);
        }