Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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");
        }