コード例 #1
0
 public void Fields52_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(FieldsTestClass52.testMethod());
 }
コード例 #2
0
ファイル: FieldsTests.cs プロジェクト: leeholder/Netduino_SDK
 public MFTestResults Fields52_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 (FieldsTestClass52.testMethod())
     {
         return(MFTestResults.Pass);
     }
     return(MFTestResults.Fail);
 }