Beispiel #1
0
        private void StructureTest()
        {
            StructTest st = new StructTest(1);

            featureTest.AssertTrue(st.data == 1);
            st += 1;
            featureTest.AssertTrue(st.data == 2);
            featureTest.AssertTrue((st &= 1).data == 0);
            st.data = 1;
            featureTest.AssertTrue((st &= 1).data != 0);
            featureTest.AssertTrue(st.data == 1);
            PassByValueTest(st);
            featureTest.AssertTrue(st.data == 1);
            st.data = 1;
            PassByReferenceTest(ref st);
            featureTest.AssertTrue(st.data == 2);
        }
Beispiel #2
0
 private void PassByReferenceTest(ref StructTest st)
 {
     st += 1;
     featureTest.AssertTrue(st.data == 2);
 }
Beispiel #3
0
 private void PassByValueTest(StructTest st)
 {
     st += 1;
     featureTest.AssertTrue(st.data == 2);
 }