mirror of https://github.com/mono/CppSharp.git
c-sharpdotnetmonobindingsbridgecclangcpluspluscppsharpglueinteropparserparsingpinvokeswigsyntax-treevisitorsxamarinxamarin-bindings
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
1.6 KiB
69 lines
1.6 KiB
using CppSharp.Utils; |
|
using NUnit.Framework; |
|
using CLI; |
|
|
|
public class CLITests : GeneratorTestFixture |
|
{ |
|
[Test] |
|
public void TestTypes() |
|
{ |
|
// Attributed types |
|
using (var types = new Types()) |
|
{ |
|
var sum = types.AttributedSum(3, 4); |
|
Assert.That(sum, Is.EqualTo(7)); |
|
} |
|
} |
|
|
|
[Test] |
|
public void TestStdString() |
|
{ |
|
using (var date = new Date(0, 0, 0)) |
|
{ |
|
Assert.AreEqual("test_test", date.TestStdString("test")); |
|
} |
|
} |
|
|
|
[Test] |
|
public void GetEmployeeNameFromOrgTest() |
|
{ |
|
using (var org = new EmployeeOrg()) |
|
{ |
|
Assert.AreEqual("Employee", org.Employee.Name); |
|
} |
|
} |
|
|
|
[Test] |
|
public void TestConsumerOfEnumNestedInClass() |
|
{ |
|
using (var consumer = new NestedEnumConsumer()) |
|
{ |
|
Assert.AreEqual(ClassWithNestedEnum.NestedEnum.E1, consumer.GetPassedEnum(ClassWithNestedEnum.NestedEnum.E1)); |
|
} |
|
} |
|
|
|
[Test] |
|
public void TestChangePassedMappedTypeNonConstRefParam() |
|
{ |
|
using (var consumer = new TestMappedTypeNonConstRefParamConsumer()) |
|
{ |
|
string val = "Initial"; |
|
consumer.ChangePassedMappedTypeNonConstRefParam(ref val); |
|
|
|
Assert.AreEqual("ChangePassedMappedTypeNonConstRefParam", val); |
|
} |
|
} |
|
|
|
[Test] |
|
public void TestVectorPointerGetter() |
|
{ |
|
using (VectorPointerGetter v = new VectorPointerGetter()) |
|
{ |
|
var list = v.VecPtr; |
|
|
|
Assert.AreEqual(1, list.Count); |
|
|
|
Assert.AreEqual("VectorPointerGetter", list[0]); |
|
} |
|
} |
|
} |