コード例 #1
0
 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());
 }
コード例 #2
0
ファイル: FieldsTests.cs プロジェクト: leeholder/Netduino_SDK
 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);
 }
コード例 #3
0
            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);
                }
            }
コード例 #4
0
            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;
                }
            }