public void Fields14_testMethod()
 {
     OutputHelper.WriteLine(" Section 10.4");
     OutputHelper.WriteLine(" A static field identifies exactly on storage location.");
     OutputHelper.WriteLine(" No matter how many instances of a class are created,");
     OutputHelper.WriteLine(" there is only ever one copy of a static field.");
     Assert.True(FieldsTestClass14.testMethod());
 }
Example #2
0
 public MFTestResults Fields14_testMethod()
 {
     Log.Comment(" Section 10.4");
     Log.Comment(" A static field identifies exactly on storage location.");
     Log.Comment(" No matter how many instances of a class are created,");
     Log.Comment(" there is only ever one copy of a static field.");
     if (FieldsTestClass14.testMethod())
     {
         return(MFTestResults.Pass);
     }
     return(MFTestResults.Fail);
 }
            public static bool testMethod()
            {
                FieldsTestClass14 c1 = new FieldsTestClass14();

                c1.ChangeInt(2);
                FieldsTestClass14 c2 = new FieldsTestClass14();

                c1.ChangeInt(3);
                FieldsTestClass14 c3 = new FieldsTestClass14();

                c1.ChangeInt(4);

                if (intI == 4)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            public static bool testMethod()
            {

                FieldsTestClass14 c1 = new FieldsTestClass14();
                c1.ChangeInt(2);
                FieldsTestClass14 c2 = new FieldsTestClass14();
                c1.ChangeInt(3);
                FieldsTestClass14 c3 = new FieldsTestClass14();
                c1.ChangeInt(4);

                if (intI == 4)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }