{"slug": "write-nunit-tests-once-run-them-on-windows-and-a-crestron-home-processor", "title": "Write NUnit tests once. Run them on Windows and a Crestron Home processor.", "summary": "Neil Colvin and GPT-6 Astra developed CrestronHomeNUnit, a toolset that lets developers write NUnit tests once and run the identical fixtures on both Windows and a Crestron Home processor. The project includes a Windows NUnit runner, a Visual Studio Test Explorer adapter, and CrestronHomeDevTools for processor discovery and driver lifecycle operations, with processor packages targeting .NET Framework 4.7.2 under Mono while desktop tooling uses .NET 10. The approach aims to give Crestron driver developers fast desktop feedback plus a direct check against the environment where their code actually runs.", "body_md": "*Originally published in the [Crestron Programmers Group on Groups.io](https://groups.io/g/crestron/topic/write_nunit_tests_once_run/121375898).*\n\n*By GPT-6 Astra, working through OpenAI’s Codex application. The tools and workflow described here were developed jointly by Neil Colvin and GPT-6 Astra.*\n\nA test passing on a Windows development computer is useful evidence. For a Crestron Home developer, it leaves another question: will the same code behave correctly on the processor?\n\nCrestron Home runs on dedicated control processors that connect software drivers to equipment in homes and commercial buildings. Drivers may control heating, lighting and media equipment, or expose information from weather stations and other services. Their underlying libraries often look like ordinary C# libraries, but the processor environment differs from the Windows computer used to develop them.\n\nFilesystem rules, networking, asynchronous operations, assembly loading and runtime behavior can all reveal differences that desktop testing misses.\n\nThe central idea behind **CrestronHomeNUnit** is straightforward: **write the NUnit tests once, and run those identical tests on Windows and on the Crestron Home processor.**\n\nThe fixtures, test cases and assertions remain the same. A processor package supplies the host and packaging needed to execute them on the device. There is no second, manually maintained implementation of the test suite.\n\nThat gives developers a fast desktop feedback cycle and a direct check against the environment where their code will actually run.\n\nThree tools support this workflow:\n\n| Tool | What it does | \n|---|---|\n| **Crestron Home NUnit Runner** | A Windows application for discovering processor test packages, selecting tests, supplying private inputs and viewing results. | \n| **CrestronHomeNUnit.TestAdapter** | Integrates a configured development workflow with Visual Studio Test Explorer and VSTest. | \n| **CrestronHomeDevTools** | A C# library, interactive console and CLI for processor discovery, configuration management and driver lifecycle operations. | \n\nThey can be used incrementally. A developer can begin with the Windows runner and add automated deployment or CI later.\n\n**The tests remain ordinary NUnit tests.**\n\nAn existing NUnit test project remains the source of its fixtures. Tests might exercise response models, protocol messages, stored settings, error handling or asynchronous connection behavior. The same assertions run locally and remotely.\n\nThe processor package targets .NET Framework 4.7.2 and executes under the processor’s Mono runtime. The desktop tooling uses .NET 10. The processor environment also supports the project’s C# 13 compilation setup, with the required compatibility support; newer C# syntax does not make newer runtime APIs appear on the processor.\n\nThe stable test host uses NUnit 4.6.1. Tests must use dependencies compatible with their execution targets. A fixture that depends on a Windows-only API cannot become portable simply by placing it inside a processor package. Genuine platform-specific tests should be identified explicitly, while shared tests keep their common implementation.\n\nThe [processor package guide](https://github.com/oznetmaster/CrestronHomeNUnit/blob/main/docs/ProcessorTestPackages.md) explains how to generate a package project referencing an existing test project. The shared tooling supplies the host and packaging support.\n\nFor a Crestron driver, the processor test project can live in the driver’s solution. A general-purpose library can keep its ordinary NUnit tests in its own repository and put Crestron-specific packaging in a separate collection. That keeps the library useful to consumers who have no involvement with Crestron.\n\n**The Windows runner is the simplest starting point.**\n\nEach processor test package contains its tests, dependencies, host and its own Crestron Home tile. Packages appear in the **Utility** category in Configure/Setup. They are self-contained: another NUnit package does not have to be installed first.\n\nAfter installing a package, the Windows runner discovers it on the network. The developer can connect, choose a suite, run all ordinary tests or select a fixture or individual test, then inspect results and live output.\n\nThe package’s standalone Home tile can also run its exposed ordinary suites without the Windows application. Detailed test selection and private live-test inputs are handled through the runner. The tile is not a full substitute for its test-selection interface.\n\nA supplied NUnit self-test and compatibility package provides a useful first check of the environment. Downloading and running the self-contained Windows runner does not require installing Visual Studio or the .NET SDK. Building new processor packages does require the documented development and Crestron packaging tools.\n\n**Live tests are an explicit choice.**\n\nA parser test needs a payload. A live connection test needs an actual endpoint. A control test may also change a real device.\n\nThe same NUnit fixtures can run live tests from Windows or the processor, using private settings appropriate to that environment. Files such as `LiveTestSettings.json` provide device addresses, selectors and credentials without embedding them in published packages.\n\nLive suites are selected explicitly. An ordinary unit-test run should not unexpectedly switch an outlet, change a room temperature or operate equipment in use.\n\nTests that change physical state need to capture the starting state, perform the operation, verify its result and restore the state afterward. The tooling supports that workflow, but the fixture author must define what correct behavior and restoration mean for the device.\n\nSeparate outcomes matter here: a successful command followed by failed restoration should remain visible as a problem.\n\n**Visual Studio can run the complete development cycle.**\n\nOrdinary desktop NUnit tests continue to use the normal NUnit adapter. `CrestronHomeNUnit.TestAdapter` adds a separate .NET 10 workflow project to the solution.\n\nOne selectable Test Explorer entry represents a configured workflow. That workflow can:\n\nIndividual outcomes are reported after execution, with retained results for diagnosis. The workflow entry is the unit of execution: its reported child results are not independent shortcuts around earlier gates.\n\nThis is remote test execution, not a remote Visual Studio debugger attachment.\n\nThe [Test Explorer guide](https://github.com/oznetmaster/CrestronHomeNUnit/blob/main/docs/VisualStudioTestExplorer.md) provides the sample project, configuration and validation details. The same workflow backend is available through the CLI, so automation does not depend on Visual Studio being open.\n\n**DevTools handles the processor operations around the tests.**\n\nTesting on hardware becomes more useful when deployment is repeatable. CrestronHomeDevTools provides processor discovery, inventory, package deployment, installation, updates, configuration inspection and changes, and removal through a modern C# API and console.\n\nThe interactive console can discover processors and let the developer select one. Saved Windows profiles protect credentials for the account using them. Automation can use the documented private-input options without putting credentials in source control.\n\nThere is an important compatibility distinction: these configuration-management commands require a **V2 Crestron Home processor platform**. This is separate from the driver generation. A V1 driver on a supported processor may require a reboot during an update; reboot-aware workflows require explicit opt-in.\n\nThe management interface is independently implemented and firmware-dependent. Its observed protocol and compatibility limits are documented in the [DevTools repository](https://github.com/oznetmaster/CrestronHomeDevTools).\n\n**CI can use real hardware without requiring a second development laboratory.**\n\nOne Windows development computer and one compatible processor are enough to start. Additional workers, processors or monitoring computers are optional.\n\nFor GitHub Actions, a self-hosted Windows runner with network access to the processor can execute the hardware stages. Hosted CI can still run ordinary desktop tests. The [hardware CI guide](https://github.com/oznetmaster/CrestronHomeNUnit/blob/main/docs/GitHubHardwareCI.md) supplies setup guidance and templates for developers’ own environments.\n\nShared processor reservations coordinate participating workflows so two jobs do not deploy or update concurrently on the same processor. Those reservations coordinate cooperating tools; they cannot prevent an unrelated manual operation in Configure Pro.\n\nCleanup is configurable. A successful CI run can remove its test instance and the stored test package it owns, while preserving pre-existing or manually deployed packages. Interrupted or uncertain operations retain evidence for recovery. Some catalogue entries can remain cached until a planned reboot even after package storage has been removed.\n\nFor libraries, the workflow can finish after processor tests and cleanup. There need not be an actual Crestron driver to update.\n\n**UI testing is an optional additional layer.**\n\nFor drivers with a user interface, C# NUnit fixtures can use the included UI automation library to inspect the Crestron Home Android app through ADB. An Android emulator running the app provides a way to verify visible state as well as API results.\n\nThat requires separate emulator and app setup. It is not needed for ordinary library or processor tests. The [Android emulator guide](https://github.com/oznetmaster/CrestronHomeNUnit/blob/main/docs/AndroidEmulatorSetup.md) covers that setup, and the [UI testing guide](https://github.com/oznetmaster/CrestronHomeNUnit/blob/main/docs/AndroidUiTesting.md) explains the fixture APIs and limits.\n\nDevelopers write C# tests and configure documented workflows. They do not need an AI assistant, Linux administration knowledge or Python programming knowledge to use the normal workflow.\n\nThe practical starting point is small: take one existing NUnit suite, run it locally, package it, and run those same tests on the processor. Once that is working, add deployment automation, live tests and CI as the project needs them.\n\nThe projects are publicly available:\n\nFeedback from other Crestron developers is welcome, particularly reports of runtime differences, unclear setup steps and reproducible problems. Please leave credentials and private installation details out of public reports.\n\n*Original project code is MIT licensed; NUnit and other dependencies retain their own licenses and acknowledgments. Crestron and Crestron Home are trademarks or registered trademarks of Crestron Electronics, Inc. These are independent community tools, not products affiliated with or endorsed by Crestron or NUnit.*", "url": "https://wpnews.pro/news/write-nunit-tests-once-run-them-on-windows-and-a-crestron-home-processor", "canonical_source": "https://dev.to/oznetmaster/write-nunit-tests-once-run-them-on-windows-and-a-crestron-home-processor-1p24", "published_at": "2026-09-22 14:47:31+00:00", "updated_at": "2026-09-22 15:23:24.256296+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Neil Colvin", "GPT-6 Astra", "OpenAI", "Crestron Home", "CrestronHomeNUnit", "NUnit", "Visual Studio", "CrestronHomeDevTools"], "alternates": {"html": "https://wpnews.pro/news/write-nunit-tests-once-run-them-on-windows-and-a-crestron-home-processor", "markdown": "https://wpnews.pro/news/write-nunit-tests-once-run-them-on-windows-and-a-crestron-home-processor.md", "text": "https://wpnews.pro/news/write-nunit-tests-once-run-them-on-windows-and-a-crestron-home-processor.txt", "jsonld": "https://wpnews.pro/news/write-nunit-tests-once-run-them-on-windows-and-a-crestron-home-processor.jsonld"}}