public static bool testMethod()
            {
                FieldsTestClass51 mc = new FieldsTestClass51();

                if ((mc.intI == 2) && (mc.intJ == 3))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
 public void Fields51_testMethod()
 {
     OutputHelper.WriteLine(" Section 10.4");
     OutputHelper.WriteLine(" Specifically, assignments to a readonly field");
     OutputHelper.WriteLine(" are permitted only in the following context.");
     OutputHelper.WriteLine(" ...");
     OutputHelper.WriteLine(" For an instance field, in the instance constructors");
     OutputHelper.WriteLine(" of the class that contains the field declaration, or");
     OutputHelper.WriteLine(" for a static field, in the static constructor of the");
     OutputHelper.WriteLine(" class the contains the field declaration. These are also");
     OutputHelper.WriteLine(" contexts in which it is valid to pass a readonly field");
     OutputHelper.WriteLine(" as an out or ref parameter.");
     Assert.True(FieldsTestClass51.testMethod());
 }
示例#3
0
 public MFTestResults Fields51_testMethod()
 {
     Log.Comment(" Section 10.4");
     Log.Comment(" Specifically, assignments to a readonly field");
     Log.Comment(" are permitted only in the following context.");
     Log.Comment(" ...");
     Log.Comment(" For an instance field, in the instance constructors");
     Log.Comment(" of the class that contains the field declaration, or");
     Log.Comment(" for a static field, in the static constructor of the");
     Log.Comment(" class the contains the field declaration. These are also");
     Log.Comment(" contexts in which it is valid to pass a readonly field");
     Log.Comment(" as an out or ref parameter.");
     if (FieldsTestClass51.testMethod())
     {
         return(MFTestResults.Pass);
     }
     return(MFTestResults.Fail);
 }
示例#4
0
 public static bool testMethod()
 {
     FieldsTestClass51 mc = new FieldsTestClass51();
     if ((mc.intI == 2) && (mc.intJ == 3))
     {
         return true;
     }
     else
     {
         return false;
     }
 }