public void TestCallMethodWithoutException() { // Create new WrapperClient // Remember to ensure a call to the Dispose()-Method! using (var client = new WrapperClient()) { // Make calls providing library name, function name, and parameters int x = (int)client.Invoke<GetSystemMetrics>("User32.dll", "GetSystemMetrics", new object[] { 0 }); int y = (int)client.Invoke<GetSystemMetrics>("User32.dll", "GetSystemMetrics", new object[] { 1 }); } }
public void TestMustThrowArgumentException() { using (var client = new WrapperClient()) { client.Invoke<object>(string.Empty, string.Empty, new object[0]); } }
public void TestMustThrowObjectDisposedException() { WrapperClient client; using (client = new WrapperClient()) { // Do Nothing } client.Invoke<TestStdCallDelegate>(TestDllPath, "TestStdCall", new object[0]); }
public void TestNormalFunc() { int input = 5; int result; using (var client = new WrapperClient()) { result = (int)client.Invoke<TestNormalFuncDelegate>(TestDllPath, "TestNormalFunc", new object[] { input }); } Assert.AreNotEqual(input, result); }
public void TestStdCall() { int input = 5; int result; using (var client = new WrapperClient()) { result = (int)client.Invoke<TestStdCallDelegate>(TestDllPath, "TestStdCall", new object[] { input }); } Assert.AreEqual(input, result); }
public void TestPWideCharHandling() { string input = "Hello World"; string result; using (var client = new WrapperClient()) { result = (string)client.Invoke<TestPWideCharHandlingDelegate>(TestDllPath, "TestPWideCharHandling", new object[] { input }); } Assert.AreEqual(input, result); }