{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"Ocean plug-in unit testing","description":"Accelerate E&P application development and protect your innovation by consuming our Data and Domain APIs / Platform APIs.","lang":"en-US","meta":[{"name":"robots","content":"noindex"}],"llmstxt":{"hide":true,"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"ocean-plug-in-unit-testing","__idx":0},"children":["Ocean plug-in unit testing"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"unit-testing-overview","__idx":1},"children":["Unit testing overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Ocean API provides a testing framework that you use to run tests on your plug-in modules. You may also run tests on Petrel by using the testing framework. This allows you to create unit tests that are run in an automated build and test environment to test your plug-in when modifications are checked in."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Ocean API testing framework currently supports data access and all Ocean APIs related to data access. Some of Ocean APIs may be used only when running in test mode. These APIs are related primarily to the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Slb.Ocean.Petrel.ProjectService"]}," project-handling service. The testing framework does not support any UI-related functions, but this functionality is planned for future releases. Currently, you cannot perform tests related to items such as menus and toolbar buttons."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When you use the testing framework to run tests, Petrel initializes in test mode. Because of Petrel implementation restrictions, NUnit is the only test system currently supported. Use the test runner application associated with the test system or another test runner application."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ocean provides a wizard to create a unit test project by using the Ocean Testing framework for an existing Ocean plug-in called the Ocean Plug-in Test wizard. The Ocean Testing Framework demands several manual and time-consuming configuration steps in the process of creating a test project. To minimize manual steps, minimize mistakes, and boost developer productivity, the Ocean Plug-in Test project wizard wraps up all of these steps in three clicks."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The examples in this chapter, however, illustrate the use of the test framework by using NUnit and its associated graphical user interface. Find additional information on unit testing in the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["OceanForPetrel.chm"]}," file in the \"Testing Framework\" white paper. Additionally, the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Samples"]}," folder of your Ocean installation contains a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["UnitTesting"]}," sample."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note:"]}," Ocean Testing Framework ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PetrelEngine"]}," does not support some visualization and user interaction related APIs, like the camera for 3D window ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Window3D.Camera3D"]},", setting ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ToggleWindow"]}," domain, setting ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Intersection"]}," for ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["IntersectionWindow"]},", etc."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"create-unit-tests","__idx":2},"children":["Create unit tests"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This section outlines the steps required to create and use the unit testing framework."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"plug-in-test-wizard","__idx":3},"children":["Plug-in Test wizard"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Ocean Plug-in Test project wizard quickly and easily creates the unit test project for you. Select the Visual Studio project you want to test and the NUnit installation folder, and then create the project. The wizard handles these configuration requirements:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The test project must contain a reference to the assembly of the plug-in to be tested."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The test project assembly must be named with the same assembly name of the plug-in to be tested plus the suffix ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[".Test"]},". For example, if the assembly name of the plug-in to be tested is ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["MyCompany.MyPlugin"]}," then the test assembly name must be ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["MyCompany.MyPlugin.Test"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The test project output path (the destination where the assembly and compilation artifacts are stored) must be set to the Petrel installation folder."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Reference paths must point to the Petrel installation and public (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PETREL_HOME/Public"]},") folders as well as to any additional required folders."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A reference to the Ocean Testing Framework assembly (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Slb.Ocean.Petrel.Testing.dll"]},") must be added to the test project."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Petrel configuration file (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["petrel.exe.config"]},") must be copied into the test project, renamed with the same test project assembly name (for example, ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["MyCompany.MyPlugin.Test.dll.config"]},"), and have its property ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Copy to Output Directory"]}," set to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Copy always"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add references to NUnit unit testing framework assemblies."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note:"]}," Due to Petrel implementation restrictions, the Ocean Testing Framework supports only NUnit as the test framework."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A new Plug-in Test Visual Studio project is created, including this configuration, a test set up class, and a test template class."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Your Visual Studio Unit test project structure resembles Figure 4‑1."]},{"$$mdtype":"Tag","name":"p","attributes":{"align":"center"},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image41.5f60642f73846d00fe1f8275d35762aa5f8ec12da95d6b611f72b28373cbe0aa.24bc979a.png"},"children":[]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Figure 4‑1 Generated unit test Visual Studio project",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After you create the project files, start coding the unit test against the plug-in to be tested."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For details on how to use the Ocean Plugin Test wizard, refer to \"Creating an Ocean Plug-in Test Project\" in the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["OceanWizardsAndDevelopersTools.pdf"]}," found in your Ocean installation ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Getting Started"]}," directory."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"test-project","__idx":4},"children":["Test project"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note:"]}," The Ocean Plug-in Test wizard correctly generates your Visual Studio test project for you. This section is provided for reference."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The tests performed by the Ocean unit testing framework are defined in a separate project in your Visual Studio solution. This project must create a normal C# class library. The project must have these features:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A build target path of the Petrel installation directory."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Petrel installation directory as a reference path."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The public directory under the Petrel installation directory as a reference path."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A reference to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Slb.Ocean.Petrel.Testing.dll"]},". This is the assembly that contains the Ocean Testing Framework."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A reference to the assembly for the modules being tested."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["References to any assemblies required for your unit test system (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["NUnit"]},")."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A configuration file for the test project called ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["<testproject>.dll.config"]},", where ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["<testproject>"]}," is the name of your Visual Studio unit testing project. Copy the contents of this configuration file from your ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["petrel.exe.config"]}," file; it must include the modules defined in the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PetrelInternalTrust"]}," trust. You may include any or all of the modules defined in your ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["petrel.exe.config"]}," file. The location of this configuration file must be the same as your unit testing project assembly so set the project ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Copy to Output Directory"]}," property to ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Copy Always"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["<testproject>.dll.config"]}," configuration file for the test project, confirm these entries are there (they are set up by the wizard):"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["<configSections>"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["<section name=\"oceanConfiguration\" type=\"Slb.Ocean.Core.Configuration.OceanConfigurationSection, Slb.Ocean.Core, Version=2026.1.1.0, Culture=neutral, PublicKeyToken=14ef4a483ef6a64b\" />"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["</configSections>"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["<oceanConfiguration productName=\"Petrel 2026.1\" productFamilyName=\"Ocean Petrel\">"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["<pluginManagerSettings>"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["<pluginProviders>"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["<add uri=\"{ApplicationData}\\SLB\\Petrel\\2026\\PluginManagerSettings.xml\" typeName=\"Slb.Ocean.Core.Configuration.PluginXmlProvider, Slb.Ocean.Core\" name=\"UserAppData\" />"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["<add uri=\"{CommonApplicationData}\\SLB\\Petrel\\2026\\PluginManagerSettings.xml\" typeName=\"Slb.Ocean.Core.Configuration.PluginXmlProvider, Slb.Ocean.Core\" name=\"CommonAppData\" />"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["</pluginProviders>"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["<securityProvider uri=\"{ApplicationData}\\SLB\\Petrel\\2026\\PluginManagerSettings.xml\" typeName=\"Slb.Ocean.Core.PluginSecurityProvider, Slb.Ocean.Core\" />"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["</pluginManagerSettings>"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["</oceanConfiguration>"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A C# source file that contains a class that sets up and tears down the testing environment, shown in ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Figure 4‑2"]}," as ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["AssemblySetup.cs"]},". This class calls methods that initialize the Petrel engine before the tests start and tears down the Petrel engine after the tests complete."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Source files that contain the tests to be run. These define tests according to the test system that you are using. For NUnit, these files have a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["TestFixture"]}," attribute for the class defining the tests and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Test"]}," attributes defining each test."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{"align":"center"},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image42.0d46e3df379d600a35a090fde4903dac5d7afc3aa1fdb0f1deb701ea23f37163.24bc979a.png"},"children":[]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Figure 4‑2 Unit test project in Visual Studio",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"test-set-up-code","__idx":5},"children":["Test set up code"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note:"]}," The Ocean Plug-in Test wizard correctly sets up your Visual Studio test environment for you. This section is provided for reference."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The set up for the testing environment in Figure 4‑2 is contained in the source file ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["AssemblySetup.cs"]},". (The wizard generates the file named ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PluginTestSetup.cs"]},".) This source is mostly the same for any unit test projects you create. It contains a class that has methods that run before and after the tests are run."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Windows.Forms;\nusing System.Reflection;\nusing System.IO;\nusing Slb.Ocean.Basics;\nusing Slb.Ocean.Coordinates;\nusing Slb.Ocean.Core;\nusing Slb.Ocean.Data.Hosting;\nusing Slb.Ocean.Geometry;\nusing Slb.Ocean.Petrel;\nusing Slb.Ocean.Petrel.Basics;\nusing Slb.Ocean.Units;\nusing Slb.Ocean.Petrel.UI;\nnamespace ChapterTwo.Example1\n{\n  public class MyPluginA : Slb.Ocean.Core.Plugin\n  { // ...\n    public override string Name\n    {\n      get { return \"My Plugin A\"; }\n    }\n    public override string DeploymentFolder\n    {\n      get { return \"MyCompanyNamePlugin A\"; }\n    }\n    public override string ImageResourceName\n    {\n      get { return null; }\n    }\n    public override string AppVersion\n    {\n      get { return \"2026.1\"; }\n    }\n    public override string Author\n    {\n      get { return \"dfoster\"; }\n    }\n    public override string Contact\n    {\n      get { return \"contact@company.info\"; }\n    }\n    public override IEnumerable<PluginIdentifier> Dependencies\n    {\n      get { return null; }\n    }\n    public override string Description\n    {\n      get { return \"\"; }\n    }\n    public override Uri PluginUri\n    {\n      get { return new Uri(\"http://www.pluginuri.info\"); }\n    }\n    public override IEnumerable<ModuleReference> Modules\n    {\n      get\n      {\n        yield return new ModuleReference(typeof(MyModule));\n      }\n    }\n    public override PluginIdentifier PluginId\n    {\n      get { return new PluginIdentifier( typeof(MyPluginA).FullName,\n      typeof(MyPluginA).Assembly.GetName().Version); }\n    }\n    public override ModuleTrust Trust\n    {\n      get { return new ModuleTrust(\"Default\"); }\n    }\n  }\n  public class MyModule : IModule\n  { /* implementation ... */\n    public MyModule(){}\n    public void Initialize() {}\n    public void Integrate() {}\n    public void IntegratePresentation() {}\n    public void Disintegrate() {}\n    public void Dispose() {}\n  }\n}\n}\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the example, the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["SetUpFixture"]}," attribute is provided to indicate that this is the set up class for the testing environment. This is a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["NUnit"]}," attribute. The ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["SetUp"]}," and ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["TearDown"]}," attributes are also ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["NUnit"]}," attributes and, as their names imply, they are used to define the method to call before running tests and the method to call when all tests are run. Within these methods you do whatever is required to set up and clean up the testing environment. In the example, ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ProjectService"]}," is used to open a Petrel project that is needed for the unit tests."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["There are two different ways to set up your licenses for the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PetrelEngine"]}," to work:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The old way where you set up the profile before you use it"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The new way where you use the license bundle directly"]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the old way, you follow these steps to set up the profile before using it:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Open Petrel UI and select licenses."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Save that as a profile."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Run ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PetrelEngine"]}," with these parameters:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["PetrelEngine.Instance.Initialize(\\ \"-licensePackage <your_profile_name>\");"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the new way, follow these steps to use the license bundle:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Get your license bundle name either from the license file itself, or    from the Petrel ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["License selection"]}," dialog box. Right-click your    bundle and select ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["List users"]},", and the License ID is at the top    of the dialog box that opens."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["..."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["FEATURE [Petrel_61140362_MAAAODmgP/aUA]{.mark} slbsls 5014.12 28-may-2017 200 \\"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["VENDOR_STRING=yynnyyyyyyyyyyyyyyyyynnynyyyyyynnnnnnnnnnnnnnnnn \\"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["SUPERSEDE=Petrel_61140362_MAAAODmgP/aUA ISSUED=28-Feb-2017 \\"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["NOTICE=\"SLB R&E - STAVANGER 1-W1AQK0\" SN=1-W1AQK0 \\"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["..."]},{"$$mdtype":"Tag","name":"p","attributes":{"align":"center"},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image43.5a0a6b8633c4ba75ab3e296535a6197efc3fa97f6dbe3b99a53ccbf2c6460a8f.24bc979a.png"},"children":[]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Figure 4‑3 Bundle License Name in License users dialog box",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Run ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PetrelEngine"]}," with these parameters:"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["PetrelEngine.Instance.Initialize(\\ \"-licensePackage <your_bundle_license_name>\");"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"unit-test-code","__idx":6},"children":["Unit test code"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The unit tests you provide are defined by the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["TestFixture"]}," attribute. ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["TestFixture"]}," indicates the class that defines a set of tests. Within this class you designate tests by using the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Test"]}," attribute."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"java","header":{"controls":{"copy":{}}},"source":"using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Windows.Forms;\nusing System.Reflection;\nusing System.IO;\nusing Slb.Ocean.Basics;\nusing Slb.Ocean.Coordinates;\nusing Slb.Ocean.Core;\nusing Slb.Ocean.Data.Hosting;\nusing Slb.Ocean.Geometry;\nusing Slb.Ocean.Petrel;\nusing Slb.Ocean.Petrel.Basics;\nusing Slb.Ocean.Units;\nusing Slb.Ocean.Petrel.UI;\nnamespace ChapterTwo.Example1\n{\n  public class MyPluginA : Slb.Ocean.Core.Plugin\n  { // ...\n    public override string Name\n    {\n      get { return \"My Plugin A\"; }\n    }\n    public override string DeploymentFolder\n    {\n      get { return \"MyCompanyNamePlugin A\"; }\n    }\n    public override string ImageResourceName\n    {\n      get { return null; }\n    }\n    public override string AppVersion\n    {\n      get { return \"2026.1\"; }\n    }\n    public override string Author\n    {\n      get { return \"dfoster\"; }\n    }\n    public override string Contact\n    {\n      get { return \"contact@company.info\"; }\n    }\n    public override IEnumerable<PluginIdentifier> Dependencies\n    {\n      get { return null; }\n    }\n    public override string Description\n    {\n      get { return \"\"; }\n    }\n    public override Uri PluginUri\n    {\n      get { return new Uri(\"http://www.pluginuri.info\"); }\n    }\n    public override IEnumerable<ModuleReference> Modules\n    {\n      get\n      {\n        yield return new ModuleReference(typeof(MyModule));\n      }\n    }\n    public override PluginIdentifier PluginId\n    {\n      get { return new PluginIdentifier( typeof(MyPluginA).FullName,\n      typeof(MyPluginA).Assembly.GetName().Version); }\n    }\n    public override ModuleTrust Trust\n    {\n      get { return new ModuleTrust(\"Default\"); }\n    }\n  }\n  public class MyModule : IModule\n  { /* implementation ... */\n    public MyModule(){}\n    public void Initialize() {}\n    public void Integrate() {}\n    public void IntegratePresentation() {}\n    public void Disintegrate() {}\n    public void Dispose() {}\n  }\n}\n","lang":"java"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This test simply checks the operation of a piece of the Ocean API. In this case it creates a new project, tests if the top level ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["BoreholeCollection"]}," folder named ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Wells"]}," exists, and then creates it. Finally, it closes the project it created."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"build-the-test-assembly","__idx":7},"children":["Build the test assembly"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After the unit tests are defined, build the Visual Studio project containing them."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Note:"]}," The Ocean Plug-in Test wizard correctly sets up the environment. This information is provided for reference."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the case of ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["NUnit"]}," as a testing application, this is how the environment must be set up:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set the output testing assembly to be in the Petrel installation directory. This is defined by the environment variable ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["$(Ocean2026Home)"]},"."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["These files from the NUnit installation must be copied to the Petrel installation folder, or to a folder of your choice underneath it:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["NUnit executable and configuration files to the Petrel folder"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All assembly (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[".dll"]},") files from the NUnit ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["lib"]}," folder to the Petrel folder or a subfolder under it"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["All assembly (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[".dll"]},") files from the NUnit ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["framework"]}," folder to the Petrel folder or to a subfolder under it"]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a testing assembly configuration file in the Petrel installation directory. This ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[".xml"]}," file must be a copy of the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Petrel.exe.config"]}," file, but its name must be the same as the testing assembly file name with ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[".config"]}," appended to the end (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["SomePluginTest.dll.config"]},").\\ If you copied the NUnit files in the previous step to a subfolder of the Petrel folder then you must modify the probing path defined in the testing assembly configuration file to include the subfolder definition."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"run-the-tests","__idx":8},"children":["Run the tests"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The unit tests are run from:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Visual Studio using the NUnit Test Adapter"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["NUnit, either on the command line or with the NUnit graphical UI"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"run-tests-from-visual-studio-using-nunit-test-adapter","__idx":9},"children":["Run tests from Visual Studio using NUnit Test Adapter"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Ocean NUnit Test Adapter is a Visual Studio 2015 and Visual Studio 2019 extension that allows you to:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Display your tests in the native Test Explorer window from Visual Studio."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Run the tests and get results within the Visual Studio environment."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Have code coverage of the test execution."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Microsoft Team Foundation Server 2012 also supports this extension, which means that the tests are executed in a build environment with continuous integration."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Starting in the 2016 release you must install the Ocean NUnit Test Adapter separately. Find the installer at \\\\Program Files\\Common Files\\SLB\\Ocean\\Petrel\\Common components\\Visual Studio Extensions\\Slb.OceanSdk.Petrel.TestAdapter.vsix."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Install the test adapter after finishing the Ocean for Petrel Framework installation. Once it's done, find the Ocean NUnit Test Adapter on the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["OCEAN"]}," menu in Visual Studio, as Figure 4‑4 shows."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"select-petrel-version","__idx":10},"children":["Select Petrel version"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before running the tests, it is important to select the correct Petrel version and platform as shown in Figure 4‑4, because the test adapter needs to be aware of which Petrel version to be used in order to infer the correct Petrel installation path."]},{"$$mdtype":"Tag","name":"p","attributes":{"align":"center"},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image44.7ddc9cc81f516a0b9dea9028c5afdc9a2d295dc679459ad0dbac4c7889b33a9a.24bc979a.png"},"children":[]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Figure 4‑4 Ocean test adapter in Visual Studio 2015",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The Ocean NUnit Test Adapter requires the test assembly to be located inside Petrel's root folder in order to resolve the dependencies. For this reason, you must set the project's outputs to Petrel's root folder as well as select the correct Petrel version and platform."]},{"$$mdtype":"Tag","name":"p","attributes":{"align":"center"},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image451.4b1c3c8c50ca332b46f62ca09051a74bbf81e018d1c1df830ffb7639e394bb96.24bc979a.png"},"children":[]},{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image452.7cfaa71b55e1d12297045b345a46ad063fdca5926c7898ccb258ea107ff0d53e.24bc979a.png"},"children":[]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Figure 4‑5 Tests displayed in the Test Explorer pane in Visual Studio",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"run-the-tests-1","__idx":11},"children":["Run the tests"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After configuring the test project and the test adapter, you run the tests by using the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Test Explorer"]}," window commands (i.e. Run All and Run...); this triggers the test execution. Visualize the test adapter's output in the Visual Studio ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Output"]}," window when the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Tests"]}," option is selected in the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Show output from:"]}," combo box."]},{"$$mdtype":"Tag","name":"p","attributes":{"align":"center"},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image46.46582846ab55e88ff2491f22676ebff8a01de4d17d4985adbf975088f4aecaeb.24bc979a.png"},"children":[]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Figure 4‑6 Test output",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The first section of the output verifies if the requirements to use the Ocean Testing framework are met. This includes the verification of the existence of the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["PetrelConfiguration.xml"]}," file, a list of the installed plug-ins, and other verifications."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["It is important to watch this output, because when something goes wrong, it gives advice on how to execute the tests properly or explains why the Ocean Testing Framework could not be run."]},{"$$mdtype":"Tag","name":"p","attributes":{"align":"center"},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image47.d14df8ae3ca1672e00d345d2eccb6260eacfb0efe6fe6bfa64fbdbcbea71b612.24bc979a.png"},"children":[]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Figure 4‑7 Test Explorer with Test Results",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After the test execution finishes, the tests are updated in the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Test Explorer"]}," with the details of each test case."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Known issues to be aware of include:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Test Explorer"]}," does not support hierarchical view of the test cases. As a consequence, all tests cases are displayed in a flat list."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Debugging mode: an error message is returned if the test execution is started with the debugger attached. However, it is possible to attach the debugger after the Petrel engine is initialized."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Code coverage in Microsoft Team Foundation Server is supported. However, it is necessary to filter the assemblies under test; otherwise, the code coverage tool attaches all Petrel's assemblies. This could cause the same crash caused by the debugger."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"run-tests-from-nunit","__idx":12},"children":["Run tests from NUnit"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If the tests are run using the NUnit console then the command line is:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[">nunit-console.exe /nologo /noshadow /process=Single\\ mytesting_assembly.dll"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Start the NUnit graphical UI from Visual Studio as an external program defined in the test projects properties ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Debug"]}," tab. It recognizes the test assembly's configuration file when it starts and loads the assembly. You then simply run the tests from the NUnit GUI."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When running the tests using the GUI version of the application it is important that you clear the check box for ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Enable Shadow Copy"]},". Find this check box on the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Tools"]}," menu (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Tools"]}," - ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Settings"]},"* - ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Test Loader"]},"* - ",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["Advanced"]},"*)."]},{"$$mdtype":"Tag","name":"p","attributes":{"align":"center"},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image48.55dd525f64b08eb0e5708425b8ad93518227aba7734de82a67d05875aecc73eb.24bc979a.png"},"children":[]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Figure 4‑8 NUnit GUI with test loaded and ready to run",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When the tests are run, information about the tests is displayed:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Green or red indicators on the left side of the GUI show the status of the tests in the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Tests"]}," lists"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Output messages appear in the right side."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The status line at the bottom indicates the number of test cases, the number of tests run, and other quantitative information."]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{"align":"center"},"children":[{"$$mdtype":"Tag","name":"img","attributes":{"src":"/assets/image49.b3dbac3dc636271e672f28a52ef799a0f20ba29b165a731a84abd20702a6d352.24bc979a.png"},"children":[]},{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]},"Figure 4‑9 NUnit GUI with tests completed",{"$$mdtype":"Tag","name":"br","attributes":{},"children":[]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"troubleshooting-nunit","__idx":13},"children":["Troubleshooting NUnit"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In these steps, your NUnit version may differ; make changes as appropriate."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A common error you may see when a dll is missing or not loaded is:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark) at System.Reflection.Assembly.GetTypes() at Slb.Ocean.Petrel.Testing.PetrelEngine.InitializeInstance() at Slb.Ocean.Petrel.Testing.PetrelEngine.get_Instance() at UnitTestDemo.AssemblySetUp.RunBeforeAnyTests() in C:\\Program Files\\SLB\\Ocean 202X\\Samples\\UnitTesting\\UnitTest\\AssemblySetup.cs:line 30"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you have trouble getting your NUnit test to run, check these items."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"invisualstudio","__idx":14},"children":["In Visual Studio"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Follow these steps in Visual Studio:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check the reference path for both projects in this solution    (TestModule and UnitTest) point to the Petrel instance you want    to use, for example:"]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["C:\\Program Files\\SLB\\Petrel 2026\\,    C:\\Program Files\\SLB\\Petrel 2026\\Public\\"]},"*"]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check the output path (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Build"]},"  tab). For the TestModule project, set to the Petrel ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Extensions"]}," folder. For    example:"]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["C:\\Program Files\\SLB\\Petrel 2026\\Extensions\\"]},"*"]}]}]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":3},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Check the output path (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Build"]},"  tab).    For UnitTest project, set to the Petrel root. For example:"]}]},{"$$mdtype":"Tag","name":"blockquote","attributes":{},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"em","attributes":{},"children":["C:\\Program Files\\SLB\\Petrel 2026\\"]},"*"]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"inthe-filetree","__idx":15},"children":["In the File tree"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Follow these steps in the File tree:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Make sure you have the additional testing assemblies copied    to the Petrel root. For example, copy all files and subfolders from:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["C:\\Program Files (x86)\\NUnit X.X.X\\bin\\net-X.X"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["to"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["C:\\Program Files\\SLB\\Petrel 2026\\"]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Make sure that  ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["nunit.exe.config"]},"  and/or  ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["nunit-console.exe.config"]},"    (in    Petrel root) has the same settings in  ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["ProbingPath"]},"  as  ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Petrel.exe.config."]}," In    other words, it must be the original path (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["lib; addins;"]},") plus    all paths from Petrel. For example:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["probing privatePath=\"lib;addins;Public;Extensions;Printing;Extensions\\SLB\\...\""]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Build the solution."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Start the NUnit-console (on    the command line, from Petrel root) with these\\    command-line parameters:"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["nunit-console.exe /nologo /noshadow /process=Single UnitTest.dll"]}]}]}]}]},"headings":[{"value":"Ocean plug-in unit testing","id":"ocean-plug-in-unit-testing","depth":1},{"value":"Unit testing overview","id":"unit-testing-overview","depth":2},{"value":"Create unit tests","id":"create-unit-tests","depth":2},{"value":"Plug-in Test wizard","id":"plug-in-test-wizard","depth":3},{"value":"Test project","id":"test-project","depth":3},{"value":"Test set up code","id":"test-set-up-code","depth":3},{"value":"Unit test code","id":"unit-test-code","depth":3},{"value":"Build the test assembly","id":"build-the-test-assembly","depth":3},{"value":"Run the tests","id":"run-the-tests","depth":2},{"value":"Run tests from Visual Studio using NUnit Test Adapter","id":"run-tests-from-visual-studio-using-nunit-test-adapter","depth":3},{"value":"Select Petrel version","id":"select-petrel-version","depth":4},{"value":"Run the tests","id":"run-the-tests-1","depth":4},{"value":"Run tests from NUnit","id":"run-tests-from-nunit","depth":3},{"value":"Troubleshooting NUnit","id":"troubleshooting-nunit","depth":2},{"value":"In Visual Studio","id":"invisualstudio","depth":3},{"value":"In the File tree","id":"inthe-filetree","depth":3}],"frontmatter":{"seo":{"title":"Ocean plug-in unit testing"}},"lastModified":"2026-02-11T12:13:31.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/solutions/ocean-petrel/dev-guide/11_licensingdeploymentunittesting/11_licensingdeploymentunittesting_4","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}