public void IsTestClassReturnsFalseWhenClassHasTestAttributeWithoutUsingNUnit()
        {
            var c = NRefactoryHelper.CreateTypeDefinition("class C { [Test] public void M() {} }");

            Assert.IsFalse(NUnitTestFramework.IsTestClass(c));
        }
        public void IsTestClassReturnsTrueWhenContainingTestMethod()
        {
            var c = NRefactoryHelper.CreateTypeDefinition("using NUnit.Framework; class C { [Test] public void M() {} }");

            Assert.IsTrue(NUnitTestFramework.IsTestClass(c));
        }
        public void IsTestClassReturnsFalseWhenClassHasTestFixtureAttributeAndIsAbstract()
        {
            var c = NRefactoryHelper.CreateTypeDefinition("using NUnit.Framework; [TestFixture] abstract class EmptyClass {}");

            Assert.IsFalse(NUnitTestFramework.IsTestClass(c));
        }
        public void IsTestClassReturnsTrueHasClassHasFullyQualifiedNUnitTestFixtureAttribute()
        {
            var c = NRefactoryHelper.CreateTypeDefinition("[NUnit.Framework.TestFixtureAttribute] class EmptyClass {}");

            Assert.IsTrue(NUnitTestFramework.IsTestClass(c));
        }
        public void IsTestClassReturnsTrueHasClassHasTestFixtureAttributeMissingAttributePart()
        {
            var c = NRefactoryHelper.CreateTypeDefinition("using NUnit.Framework; [TestFixture] class EmptyClass {}");

            Assert.IsTrue(NUnitTestFramework.IsTestClass(c));
        }
        public void IsTestClassReturnsFalseHasClassHasNoAttributes()
        {
            var c = NRefactoryHelper.CreateTypeDefinition("class EmptyClass {}");

            Assert.IsFalse(NUnitTestFramework.IsTestClass(c));
        }
        public void IsTestClassReturnsTrueWhenStaticClassWithAttribute()
        {
            var c = NRefactoryHelper.CreateTypeDefinition("using NUnit.Framework; [TestFixture] static class C { }");

            Assert.IsTrue(NUnitTestFramework.IsTestClass(c));
        }
        public void IsTestClassReturnsTrueWhenAbstractClassContainsInnerClassWithTestMethod()
        {
            var c = NRefactoryHelper.CreateTypeDefinition("using NUnit.Framework; abstract class C { class Inner { [Test] public void M() {} } }");

            Assert.IsTrue(NUnitTestFramework.IsTestClass(c));
        }
        IMethod CreateMethod(string code)
        {
            var c = NRefactoryHelper.CreateTypeDefinition("using NUnit.Framework; class C { " + code + " } ");

            return(c.Methods.First());
        }