Example #1
0
        public void DoTest(string testName, string fileName)
        {
            RunTest(testName, registrations =>
            {
                ICSharpFile file = GetCodeFile(fileName);

                Assert.AreEqual(1, registrations.Count());
                file.ProcessChildren <ITypeDeclaration>(declaration =>
                                                        Assert.That(registrations.First().Registration.IsSatisfiedBy(declaration.DeclaredElement)));
            });
        }
        protected void RunTest(string testName, Action <ILambdaExpression> action)
        {
            string fileName = testName + Extension;

            WithSingleProject(fileName, (lifetime, project) => RunGuarded(() =>
            {
                ICSharpFile file = GetCodeFile(fileName);
                if (file == null || string.IsNullOrWhiteSpace(file.GetText()))
                {
                    Assert.Fail("The file '{0}' was not found or was empty.", fileName);
                }

                file.ProcessChildren(action);
            }));
        }