Zlepper.RimWorld.ModSdk.Testing
0.0.6
See the version list below for details.
<Sdk Name="Zlepper.RimWorld.ModSdk.Testing" Version="0.0.6" />
RimWorld ModSdk for unit testing
This is a variant of the Zlepper.RimWorld.ModSdk
package, which is used for unit testing.
It is not intended to be used for actual mod development. I would recommend reading the
documentation for that package first, and then come back here.
This package enables using testing through NUnit. If you want to use XUnit or equivalent, you will have to do some work yourself. I have not tested this with other testing frameworks, but it should be possible to get it working with some tweaking.
Installation
Like for the normal ModSdk you have to create a new project, but instead you use this configuration in the .csproj file:
<Project Sdk="Zlepper.RimWorld.ModSdk.Testing/0.0.4">
<ItemGroup>
<ProjectReference Include="..\MyMod\MyMod.csproj"/>
</ItemGroup>
</Project>
This assumes that you have a project called MyMod
in the same solution, which is the project you want to test.
Now you can start writing your NUnit tests as you always do.
Configuration
There a fewer configuration than for the normal ModSdk
since you don't need to run something,
so here is just an overview of the settings:
<PropertyGroup>
<Nullable>enable</Nullable>
<LangVersion>10</LangVersion>
<RimWorldImplicitUsings>enable</RimWorldImplicitUsings>
<RimWorldPath>C:\Program Files (x86)\Steam\steamapps\common\RimWorld</RimWorldPath>
</PropertyGroup>
Adding a reference to a RimWorld assembly
By default the SDK references Assembly-CSharp
and UnityEngine.CoreModule
for you. If you need to reference
another assembly, you can do so by adding a reference to it in the project file. For example, if you want to
reference UnityEngine.IMGUIModule
, you can add the following to your project file. Sadly these kind of references
are not transitively inherited from the mod project itself, so you have to repeat them here again.
<ItemGroup>
<RimWorldAssemblyReference Include="UnityEngine.IMGUIModule"/>
</ItemGroup>
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.