Skip to content

Unit Testing

mattl91 edited this page Mar 9, 2026 · 4 revisions

Harmony Core Logo

Unit Testing

This page is an overview for unit testing in Harmony Core. For a full walkthrough, see Tutorial 5: Unit Testing Generated OData Services.

Harmony Core unit testing for OData services uses the following:

  • The Services.Test project for generated unit test classes and the test host environment.
  • The Services.Test.GenerateValues project to generate or update TestConstants.Values.json from your data.
  • Generated tests that call your service endpoints through HttpClient against the in-process test host, using the same HTTP/OData API.

Prerequisites

Before setting up unit tests, you should already have a working Harmony Core solution with generated OData services created from Tutorial 2: Building a Service From Scratch.

Recommended Setup Path

Follow Tutorial 5 end-to-end. It covers:

  1. Adding the test projects.
  2. Running upgrade and sync steps.
  3. Enabling unit test code generation.
  4. Regenerating code.
  5. Verifying required package references.
  6. Building and running tests.

Also See

Clone this wiki locally