public void Fields41_testMethod()
 {
     OutputHelper.WriteLine(" Section 10.4");
     OutputHelper.WriteLine(" A static readonly field is useful when a symbolic");
     OutputHelper.WriteLine(" name for a constant value is desired, but when the ");
     OutputHelper.WriteLine(" type of the value is not permitted in a const declaration");
     OutputHelper.WriteLine(" or when the value cannot be computed at compile-time");
     OutputHelper.WriteLine(" by a constant expression.");
     Assert.True(FieldsTestClass41.testMethod());
 }
Esempio n. 2
0
 public MFTestResults Fields41_testMethod()
 {
     Log.Comment(" Section 10.4");
     Log.Comment(" A static readonly field is useful when a symbolic");
     Log.Comment(" name for a constant value is desired, but when the ");
     Log.Comment(" type of the value is not permitted in a const declaration");
     Log.Comment(" or when the value cannot be computed at compile-time");
     Log.Comment(" by a constant expression.");
     if (FieldsTestClass41.testMethod())
     {
         return(MFTestResults.Pass);
     }
     return(MFTestResults.Fail);
 }
            public static bool testMethod()
            {
                FieldsTestClass41 wht = FieldsTestClass41.White;
                byte r2, g2, b2;

                wht.getRGB(out r2, out g2, out b2);
                if ((r2 == 255) && (g2 == 255) && (b2 == 255))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }