public void Modifiers23_Test() { OutputHelper.WriteLine("An abstract class cannot be instantiated, and it is"); OutputHelper.WriteLine("an error to use the new operator on an abstract class."); OutputHelper.WriteLine("While it is possible to have variables and values whose"); OutputHelper.WriteLine("compile-time types are abstract, such variables and values"); OutputHelper.WriteLine("will necessarily either be null or contain references"); OutputHelper.WriteLine("to instances of non-abstract classes derived from the "); OutputHelper.WriteLine("abstract types."); Assert.True(ModifiersTestClass23.testMethod()); }
public static bool testMethod() { ModifiersTestClass23 test = new ModifiersTestClass23(); if (test.A == null) { return(true); } else { return(false); } }
public MFTestResults Modifiers23_Test() { Log.Comment("An abstract class cannot be instantiated, and it is"); Log.Comment("an error to use the new operator on an abstract class."); Log.Comment("While it is possible to have variables and values whose"); Log.Comment("compile-time types are abstract, such variables and values"); Log.Comment("will necessarily either be null or contain references"); Log.Comment("to instances of non-abstract classes derived from the "); Log.Comment("abstract types."); if (ModifiersTestClass23.testMethod()) { return(MFTestResults.Pass); } return(MFTestResults.Fail); }
public static bool testMethod() { ModifiersTestClass23 test = new ModifiersTestClass23(); if (test.A == null) { return true; } else { return false; } }