Documentation

​
​

Development

User Acquisition

Monetization

Industry

Cloud Code

Scripting API

Services C# SDKs

Services JavaScript SDKs

Admin REST API

Client REST API

Scheduler Admin REST API

Observability REST API

Open Unity Dashboard

Cloud Code

LiveOps
​
​
Cloud Code
  • Overview
  • Get started
  • Server authority
  • Cloud Code C# modules
    • Overview
    • Get started
    • Concepts
    • Tutorials
      • Run modules
      • Write modules
      • Development essentials
        • Write unit tests
          • Create a unit test project
          • Create a unit test
        • Dependency injection
        • Custom serialization
        • Batch requests
        • In-memory cache
      • Automate deployment
      • Integrate services
      • Advanced configuration
      • Use Cases
    • Reference
  • Cloud Code JavaScript scripts
  • Logging
  • Use-case samples
  • Privacy and consent
  1. Cloud Code

Create a unit test project

Set up a unit test project in JetBrains Rider or Microsoft Visual Studio.
Read time 1 minute
Last updated 9 months ago

Before you create a unit test, first set up a unit test project. This page describes how to set up a project in the following IDEs:

JetBrains Rider

  1. Select File > New....
  2. Select a Unit Test Project, making sure that you select the right template for either .Net Core or .Net Framework (this must be match your module project).
  3. Name the test project.
  4. Select Create.

Microsoft Visual Studio

  1. Right-click the solution, then Add > New Project....
  2. Select .NET > NUnit Library Project.
  3. Select Next.
  4. Name the test project.
  5. Select Create.

Exclude unit tests from publishing

Exclude your test projects from publishing to prevent size issues and inefficiencies with your modules. You can exclude test projects in the following ways:

Remove from solution release configuration

In your IDE, open the solution configuration and remove the test project from the release configuration. They should not be enabled for build.
Examples for Visual Studio and Rider below:
Rider Solution Config Management

Rider Solution Config Management

VS Solution Config Management

VS Solution Config Management

Set IsPublishable to false

In your unit test project properties, set
IsPublishable
to false:
<PropertyGroup> ... <IsPublishable>false</IsPublishable> .... </PropertyGroup>

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.

  • On this page
    • JetBrains Rider

    • Microsoft Visual Studio

    • Exclude unit tests from publishing

      • Remove from solution release configuration

      • Set IsPublishable to false


Report a problem with this page