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.
55 lines
1.7 KiB
55 lines
1.7 KiB
// |
|
// CppLibraryTests.cs: Test cases to exercise CppLibrary |
|
// |
|
// Author: |
|
// Alexander Corrado (alexander.corrado@gmail.com) |
|
// |
|
// Copyright (C) 2010 Alexander Corrado |
|
// |
|
|
|
using System; |
|
using NUnit.Framework; |
|
|
|
using Mono.VisualC.Interop; |
|
using Mono.VisualC.Interop.ABI; |
|
|
|
using Tests.Support; |
|
|
|
namespace Tests { |
|
[TestFixture] |
|
public class CppLibraryTests : CPPTestLibBase { |
|
|
|
[Test] |
|
[ExpectedException (typeof (ArgumentNullException))] |
|
public void TestCreateNullAbi () |
|
{ |
|
CppLibrary cppl = new CppLibrary ("foo", null); |
|
} |
|
|
|
[Test] |
|
[ExpectedException (typeof (ArgumentNullException))] |
|
public void TestCreateNullLibName () |
|
{ |
|
CppLibrary cppl = new CppLibrary (null, new VirtualOnlyAbi ()); |
|
} |
|
|
|
[Test] |
|
public void TestProperties () |
|
{ |
|
VirtualOnlyAbi abi = new VirtualOnlyAbi (); |
|
CppLibrary cppl = new CppLibrary ("FooLib", abi); |
|
Assert.AreEqual ("FooLib", cppl.Name, "#A1"); |
|
Assert.AreSame (abi, cppl.Abi, "#A2"); |
|
} |
|
|
|
[Test] |
|
public void TestGetClass () |
|
{ |
|
VirtualOnlyAbi abi = new VirtualOnlyAbi (); |
|
CppLibrary cppl = new CppLibrary ("FooLib", abi); |
|
EmptyTestInterface klass = cppl.GetClass<EmptyTestInterface,EmptyTestStruct,CPPTestLibBase> ("FooClass"); |
|
Assert.IsNotNull (klass, "#A1"); |
|
} |
|
} |
|
} |
|
|
|
|