static void TestComplexDllMemUsage() { Console.WriteLine("DllMemUsage:Use Arg and ReturnType,"); UseComplexDllByStatic instance = new UseComplexDllByStatic(); instance.TestReturnStructByNew(); instance.TestReturnStructByArg(); Console.WriteLine("DllMemUsage:Test END\n"); }
public void TestComplexDllImport() { NameEntityType allType = NameEntityType.OrganizationName | NameEntityType.PersonName | NameEntityType.PlaceName; UseComplexDllByStatic nameFinder = new UseComplexDllByStatic(allType); //param is not didn't use bool isInit = nameFinder.Initialize(@".\data"); if (isInit) { List <NameEntity> nameResults = new List <NameEntity>(); //param text is not didn't use string text = ""; bool isSuccess = nameFinder.CreateNameEntitys(text, ref nameResults); Assert.AreEqual(isSuccess, true); } }
static void TestComplexDllStatic() { Console.WriteLine("Complex: Use StaticDllImport,"); PrintCurrentProcessMemUsage(); UseComplexDllByStatic instanceUseComplexDllByStatic = new UseComplexDllByStatic(); bool isInit = instanceUseComplexDllByStatic.Initialize(@".\data"); if (isInit) { List <NameEntity> nameResults = new List <NameEntity>(); string text = ""; bool isSuccessFindNames = instanceUseComplexDllByStatic.CreateNameEntitys(text, ref nameResults); NameEntity nameEntity = new NameEntity(); bool isSuccessCreateName = instanceUseComplexDllByStatic.CreateNameEntity(ref nameEntity); } ClearMemory(); PrintCurrentProcessMemUsage(); Console.WriteLine("Complex: Test END\n"); }