Beispiel #1
0
        private ICodeFileInfo CodeFileFor(XElement el)
        {
            var fileName = string.Format("{0}//{1}", projectInfo.Path, AttributeFor(el, "Include"));
            var file     = new FileInfo(fileName);
            var codeFile = codeFileLoader.FromFile(file);

            codeFile.Project = projectInfo;
            return(codeFile);
        }
Beispiel #2
0
        public void ShouldLoadCodeFileInfo()
        {
            var file         = new FileInfo(PathToCodeFile);
            var dependencies = new List <IDeclerationInfo>
            {
                new DeclerationInfo(null, null)
            };

            declerationExaminer
            .Stub(examiner => examiner.ExamineSource(Arg <CodeFileInfo> .Is.Anything))
            .Return(dependencies);

            var codeFileInfo = codeFileLoader.FromFile(file);

            Assert.That(codeFileInfo.Name, Is.EqualTo("RootPathClass.cs"));
            Assert.That(codeFileInfo.Path, Is.EqualTo(@"c:\projects\ResolveIt\ResolveIt.Tests\bin\Debug\TestData\WellItCouldWork"));
            Assert.That(codeFileInfo.Declerations.Count(), Is.EqualTo(1));
            Assert.That(codeFileInfo.Declerations.First(), Is.EqualTo(dependencies.First()));
        }