Exemple #1
0
        private void TestInnerScope(CSharpB b)
        {
            var a = new CSharpAwithDestructor();

            a.SetName("rar");
            b.SetA(a);
        }
        public void TestWithUsing()
        {
            using ( var a = new CSharpAwithDestructor() ) {
            using ( var b = new CSharpB() ) {
                    a.SetName( "rar" );
                    b.SetA( a );

                    Assert.AreEqual( "C++ Call A:C# Hell!", b.CallA() );
                }
            }
            ClearGC();
            Assert.AreEqual( CSharpAwithDestructor.State.Destroyed, CSharpAwithDestructor.LastState );
        }
Exemple #3
0
        public void TestWithUsing()
        {
            using (var a = new CSharpAwithDestructor()) {
                using (var b = new CSharpB()) {
                    a.SetName("rar");
                    b.SetA(a);

                    Assert.AreEqual("C++ Call A:C# Hell!", b.CallA());
                }
            }
            ClearGC();
            Assert.AreEqual(CSharpAwithDestructor.State.Destroyed, CSharpAwithDestructor.LastState);
        }
 private void TestInnerScope(CSharpB b)
 {
     var a = new CSharpAwithDestructor();
     a.SetName( "rar" );
     b.SetA( a );
 }