Browse Source

Add test assembly

Nick Steyer 1 year ago
parent
commit
dc6202e244

+ 2 - 2
Assembly-CSharp-Editor.csproj

@@ -26,7 +26,7 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <NoWarn>0169</NoWarn>
-    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
@@ -35,7 +35,7 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <NoWarn>0169</NoWarn>
-    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup>
     <NoConfig>true</NoConfig>

+ 2 - 2
Assembly-CSharp.csproj

@@ -26,7 +26,7 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <NoWarn>0169</NoWarn>
-    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <DebugType>pdbonly</DebugType>
@@ -35,7 +35,7 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <NoWarn>0169</NoWarn>
-    <AllowUnsafeBlocks>True</AllowUnsafeBlocks>
+    <AllowUnsafeBlocks>False</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup>
     <NoConfig>true</NoConfig>

+ 8 - 0
Assets/Tests.meta

@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 07bb149fcc0db2941aefb63b2edc007b
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 25 - 0
Assets/Tests/CalibrationTests.cs

@@ -0,0 +1,25 @@
+using System.Collections;
+using System.Collections.Generic;
+using NUnit.Framework;
+using UnityEngine;
+using UnityEngine.TestTools;
+
+public class CalibrationTests
+{
+    // A Test behaves as an ordinary method
+    [Test]
+    public void CalibrationTestsSimplePasses()
+    {
+        // Use the Assert class to test conditions
+    }
+
+    // A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use
+    // `yield return null;` to skip a frame.
+    [UnityTest]
+    public IEnumerator CalibrationTestsWithEnumeratorPasses()
+    {
+        // Use the Assert class to test conditions.
+        // Use yield to skip a frame.
+        yield return null;
+    }
+}

+ 11 - 0
Assets/Tests/CalibrationTests.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: d5f20f4cc6cafb842bd3dcdea02cb4f5
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 6 - 0
Assets/Tests/PlayModeTests.asmdef

@@ -0,0 +1,6 @@
+{
+    "name": "PlayModeTests",
+    "optionalUnityReferences": [
+        "TestAssemblies"
+    ]
+}

+ 7 - 0
Assets/Tests/PlayModeTests.asmdef.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 78534f60b730c6b4a904ab96f253125f
+AssemblyDefinitionImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 1 - 1
Packages/manifest.json

@@ -5,7 +5,7 @@
     "com.unity.ide.rider": "3.0.13",
     "com.unity.ide.visualstudio": "2.0.14",
     "com.unity.ide.vscode": "1.2.5",
-    "com.unity.test-framework": "1.1.31",
+    "com.unity.test-framework": "1.1.33",
     "com.unity.textmeshpro": "3.0.6",
     "com.unity.timeline": "1.6.4",
     "com.unity.ugui": "1.0.0",

+ 1 - 1
Packages/packages-lock.json

@@ -95,7 +95,7 @@
       "url": "https://packages.unity.com"
     },
     "com.unity.test-framework": {
-      "version": "1.1.31",
+      "version": "1.1.33",
       "depth": 0,
       "source": "registry",
       "dependencies": {

File diff suppressed because it is too large
+ 24 - 0
PlayModeTests.csproj


+ 6 - 0
StreetLight.sln

@@ -3,6 +3,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 15
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp.csproj", "{4322513C-6AC2-9058-38C0-BCFE306751F6}"
 EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PlayModeTests", "PlayModeTests.csproj", "{09D5F060-7DCD-43E7-1F1D-49A2AAE89C7C}"
+EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp-Editor", "Assembly-CSharp-Editor.csproj", "{57A9987F-10C0-670B-4F17-846D17D9B4EE}"
 EndProject
 Global
@@ -15,6 +17,10 @@ Global
 		{4322513C-6AC2-9058-38C0-BCFE306751F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{4322513C-6AC2-9058-38C0-BCFE306751F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{4322513C-6AC2-9058-38C0-BCFE306751F6}.Release|Any CPU.Build.0 = Release|Any CPU
+		{09D5F060-7DCD-43E7-1F1D-49A2AAE89C7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{09D5F060-7DCD-43E7-1F1D-49A2AAE89C7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{09D5F060-7DCD-43E7-1F1D-49A2AAE89C7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{09D5F060-7DCD-43E7-1F1D-49A2AAE89C7C}.Release|Any CPU.Build.0 = Release|Any CPU
 		{57A9987F-10C0-670B-4F17-846D17D9B4EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{57A9987F-10C0-670B-4F17-846D17D9B4EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{57A9987F-10C0-670B-4F17-846D17D9B4EE}.Release|Any CPU.ActiveCfg = Release|Any CPU

Some files were not shown because too many files changed in this diff