director_property testcase for C# and Java

Testing std::string as director method parameter
This commit is contained in:
William S Fulton 2022-02-13 16:08:57 +00:00
commit 88f1389f80
2 changed files with 105 additions and 0 deletions

View file

@ -0,0 +1,51 @@
using System;
namespace director_propertyNamespace {
public class runme
{
static void Main()
{
{
Foo a = new MyFoo();
if (a.getA() != "") {
throw new Exception( "Test failed" );
}
a.setA("Hello");
if (a.getA() != "Hello set from MyFoo") {
throw new Exception( "Test failed" );
}
a.Dispose();
}
{
Foo a_original = new MyFoo();
Foo a = Foo.get_self(a_original);
if (a.getA() != "") {
throw new Exception( "Test failed" );
}
a.setA("Hello");
if (a.getA() != "Hello set from MyFoo") {
throw new Exception( "Test failed" );
}
a.Dispose();
}
}
}
public class MyFoo : Foo
{
public MyFoo()
: base()
{
}
public override void setA(string a)
{
base.setA(a + " set from MyFoo");
}
}
}