public void Fields22_testMethod()
 {
     OutputHelper.WriteLine(" Section 10.4");
     OutputHelper.WriteLine(" When a field-declaration includes a readonly");
     OutputHelper.WriteLine(" modifier, assignments to the fields introduced");
     OutputHelper.WriteLine(" by the declaration can only occur as part of");
     OutputHelper.WriteLine(" the declaration or in a constructor in the");
     OutputHelper.WriteLine(" same class.");
     Assert.True(FieldsTestClass22.testMethod());
 }
            public static bool testMethod()
            {
                FieldsTestClass22 MC = new FieldsTestClass22();

                if ((MC.intI == 2) && (MC.strS.Equals("MyString")) && (MC.enuE == FieldsTestClass22_Enum.a) && (MC.sctS.Test == 3) && (MC.clsC.Test == 4))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
Пример #3
0
 public MFTestResults Fields22_testMethod()
 {
     Log.Comment(" Section 10.4");
     Log.Comment(" When a field-declaration includes a readonly");
     Log.Comment(" modifier, assignments to the fields introduced");
     Log.Comment(" by the declaration can only occur as part of");
     Log.Comment(" the declaration or in a constructor in the");
     Log.Comment(" same class.");
     if (FieldsTestClass22.testMethod())
     {
         return(MFTestResults.Pass);
     }
     return(MFTestResults.Fail);
 }
Пример #4
0
            public static bool testMethod()
            {

                FieldsTestClass22 MC = new FieldsTestClass22();

                if ((MC.intI == 2) && (MC.strS.Equals("MyString")) && (MC.enuE == FieldsTestClass22_Enum.a) && (MC.sctS.Test == 3) && (MC.clsC.Test == 4))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }