<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unit testing with a database file for Arcgis Pro SDK in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unit-testing-with-a-database-file-for-arcgis-pro/m-p/853089#M4347</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I finally solved my problem:&lt;/P&gt;&lt;P&gt;1) My test project was not compiling correctly and I had to manually set it to x64&lt;/P&gt;&lt;P&gt;2) All the manual dll import is NOT necessary with Nunit 3, I simply had to use the method Host.Initialize() at the beginning of my test and all the dependency issues are solved. Make sure to run the test in a STA thread by using this before the test:&amp;nbsp;[Test, Apartment(ApartmentState.STA)]&lt;/P&gt;&lt;P&gt;3) Using the&amp;nbsp;&lt;SPAN&gt;Host.Initialize() method allow me to open the database without issue too.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Sep 2019 13:40:38 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2019-09-27T13:40:38Z</dc:date>
    <item>
      <title>Unit testing with a database file for Arcgis Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unit-testing-with-a-database-file-for-arcgis-pro/m-p/853088#M4346</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, I'm looking for a way to test the result of a query to a geodatabase and/or sqlite database file when running unit tests with Nunit in C# (Visual Studio 2017 Enterprise) for an add-in. Right now, I always get an error about&amp;nbsp;this missing DLL:&amp;nbsp;MappingCoreLib.dll when I create a queudTask to open the database even if I added this DLL in the project. I had the same issue with DADFLib.dll but adding the file to the project solved the issue for this specific file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I run the add-in, everything is working fine and the add-in project is compiling without issue which mean the SDK is correctly installed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem happen when I run this section of my unit test:&lt;/P&gt;&lt;P&gt;if (File.Exists(gdbFile.AbsolutePath))&lt;BR /&gt; {&lt;BR /&gt; Database database;&lt;/P&gt;&lt;P&gt;await QueuedTask.Run(() =&amp;gt;&lt;BR /&gt; {&lt;BR /&gt; using (database = new Database(new SQLiteConnectionPath(gdbFile)))&lt;BR /&gt; {&lt;BR /&gt; database.OpenTable(database.GetQueryDescription("ROADS"));&lt;BR /&gt; }&lt;BR /&gt; });&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;Error message&lt;/STRONG&gt;:&amp;nbsp;System.DllNotFoundException: 'Unable to load DLL 'MappingCoreLib.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This error happen when trying to open gdb or a sqlite file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anybody had this issue before and know a way to solve it? Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2019 15:02:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/unit-testing-with-a-database-file-for-arcgis-pro/m-p/853088#M4346</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-09-26T15:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Unit testing with a database file for Arcgis Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unit-testing-with-a-database-file-for-arcgis-pro/m-p/853089#M4347</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I finally solved my problem:&lt;/P&gt;&lt;P&gt;1) My test project was not compiling correctly and I had to manually set it to x64&lt;/P&gt;&lt;P&gt;2) All the manual dll import is NOT necessary with Nunit 3, I simply had to use the method Host.Initialize() at the beginning of my test and all the dependency issues are solved. Make sure to run the test in a STA thread by using this before the test:&amp;nbsp;[Test, Apartment(ApartmentState.STA)]&lt;/P&gt;&lt;P&gt;3) Using the&amp;nbsp;&lt;SPAN&gt;Host.Initialize() method allow me to open the database without issue too.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2019 13:40:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/unit-testing-with-a-database-file-for-arcgis-pro/m-p/853089#M4347</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-09-27T13:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: Unit testing with a database file for Arcgis Pro SDK</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/unit-testing-with-a-database-file-for-arcgis-pro/m-p/1249407#M9304</link>
      <description>&lt;P&gt;I am migrating to .NET 6, for the migration to ArcGIS Pro 3.0 SDK, and have some Manual UI test..... same Error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Man you are a savior.&lt;/P&gt;&lt;P&gt;I owe you a beer&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jan 2023 11:00:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/unit-testing-with-a-database-file-for-arcgis-pro/m-p/1249407#M9304</guid>
      <dc:creator>Cristian_Galindo</dc:creator>
      <dc:date>2023-01-19T11:00:59Z</dc:date>
    </item>
  </channel>
</rss>

