public void IsTestClassReturnsFalseHasClassHasNoAttributes() { var c = NRefactoryHelper.CreateTypeDefinition("class EmptyClass {}"); Assert.IsFalse(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)); }
public void IsTestClassReturnsTrueWhenStaticClassWithAttribute() { var c = NRefactoryHelper.CreateTypeDefinition("using NUnit.Framework; [TestFixture] static class C { }"); Assert.IsTrue(NUnitTestFramework.IsTestClass(c)); }
IMethod CreateMethod(string code) { var c = NRefactoryHelper.CreateTypeDefinition("using NUnit.Framework; class C { " + code + " } "); return(c.Methods.First()); }