コード例 #1
0
 public void Fields16_testMethod()
 {
     OutputHelper.WriteLine(" Section 10.4");
     OutputHelper.WriteLine(" Every instance of a class contains a separate copy");
     OutputHelper.WriteLine(" of all instance fields of the class.  An instance ");
     OutputHelper.WriteLine(" field comes into existence when a new instance of ");
     OutputHelper.WriteLine(" its class is created, and ceases to exist when there ");
     OutputHelper.WriteLine(" are no references to that instance and the destructor");
     OutputHelper.WriteLine(" of the instance has executed.");
     Assert.True(FieldsTestClass16.testMethod());
 }
コード例 #2
0
ファイル: FieldsTests.cs プロジェクト: leeholder/Netduino_SDK
 public MFTestResults Fields16_testMethod()
 {
     Log.Comment(" Section 10.4");
     Log.Comment(" Every instance of a class contains a separate copy");
     Log.Comment(" of all instance fields of the class.  An instance ");
     Log.Comment(" field comes into existence when a new instance of ");
     Log.Comment(" its class is created, and ceases to exist when there ");
     Log.Comment(" are no references to that instance and the destructor");
     Log.Comment(" of the instance has executed.");
     if (FieldsTestClass16.testMethod())
     {
         return(MFTestResults.Pass);
     }
     return(MFTestResults.Fail);
 }
コード例 #3
0
            public static bool testMethod()
            {
                FieldsTestClass16 c1 = new FieldsTestClass16();

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

                c2.ChangeInt(3);
                FieldsTestClass16 c3 = new FieldsTestClass16();

                c3.ChangeInt(4);

                if ((c1.intI == 2) && (c2.intI == 3) && (c3.intI == 4))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
コード例 #4
0
            public static bool testMethod()
            {

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

                if ((c1.intI == 2) && (c2.intI == 3) && (c3.intI == 4))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }