Update library structure to split off Testing utilities from the Utility area

This commit is contained in:
2026-06-05 22:28:13 -04:00
parent 360657a2e9
commit b80346f3b4
15 changed files with 58 additions and 10 deletions
+4 -3
View File
@@ -3,15 +3,16 @@
"rootNamespace": "BracerLib.Tests",
"references": [
"UnityEngine.TestRunner",
"BracerLib"
"BracerLib",
"BracerLib.Utility.Testing"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll",
"Moq.dll"
"Moq.dll",
"nunit.framework.dll"
],
"autoReferenced": true,
"defineConstraints": [
@@ -1,5 +1,6 @@
using System;
using System.Collections;
using BracerLib.Utility.Testing;
using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
@@ -1,4 +1,5 @@
using System.Collections;
using BracerLib.Utility.Testing;
using Moq;
using NUnit.Framework;
using UnityEngine;
@@ -1,5 +1,6 @@
using System;
using System.Collections;
using BracerLib.Utility.Testing;
using UnityEngine;
using UnityEngine.Assertions;
using UnityEngine.TestTools;
@@ -1,4 +1,5 @@
using System.Collections;
using BracerLib.Utility.Testing;
using UnityEngine.Assertions;
using UnityEngine.SceneManagement;
using UnityEngine.TestTools;
@@ -1,7 +1,7 @@
using System.Collections;
using BracerLib.Utility;
using BracerLib.Utility.Testing;
using NUnit.Framework;
using UnityEngine;
namespace BracerLib.Tests.Utility
{
@@ -2,6 +2,7 @@
using System.Collections;
using System.Collections.Generic;
using BracerLib.Utility;
using BracerLib.Utility.Testing;
using NUnit.Framework;
using UnityEngine;
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c46ea07e02074d340aa2434ad26fcc12
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,19 @@
{
"name": "BracerLib.Utility.Testing",
"rootNamespace": "BracerLib.Utility.Testing",
"references": [
"GUID:27619889b8ba8c24980f49ee34dbb44a"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [
"Moq.dll",
"nunit.framework.dll"
],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f1e562b6a035c2b4d9c0bd9fb0d2e18f
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,7 +1,7 @@
using UnityEngine;
using UnityEngine.TestTools;
namespace BracerLib.Tests
namespace BracerLib.Utility.Testing
{
[ExecuteInEditMode]
[ExcludeFromCoverage]
@@ -12,7 +12,7 @@ using UnityEngine.SceneManagement;
using UnityEngine.TestTools;
using Object = UnityEngine.Object;
namespace BracerLib.Tests
namespace BracerLib.Utility.Testing
{
[ExcludeFromCodeCoverage, ExcludeFromCoverage]
public class TestBase
@@ -273,12 +273,12 @@ namespace BracerLib.Tests
/// var obj = new SomeObject();
/// SetReflectedValue(obj, "item", 25);
/// </code></example>
private protected void SetReflectedValue(object targetObject, string targetProperty, object targetValue)
protected internal void SetReflectedValue(object targetObject, string targetProperty, object targetValue)
{
SetReflectedValue(targetObject, targetObject.GetType(), targetProperty, targetValue);
}
private protected void SetReflectedValues(object targetObject, params ValueTuple<string, object>[] properties)
protected internal void SetReflectedValues(object targetObject, params ValueTuple<string, object>[] properties)
{
var type = targetObject.GetType();
@@ -303,7 +303,7 @@ namespace BracerLib.Tests
///
/// SetObjectReference(c, "item", someOtherObj);
/// </code></example>
private protected void SetObjectReference(Object targetObj, string targetValue, Object value)
protected internal void SetObjectReference(Object targetObj, string targetValue, Object value)
{
if (!objectPropertyCache.TryGetValue(targetObj, out var serializedObject))
{
@@ -332,7 +332,7 @@ namespace BracerLib.Tests
///
/// SetObjectReference(c, a);
/// </code></example>
private protected void SetObjectReferences(Object targetObj, params ValueTuple<string, Object>[] properties)
protected internal void SetObjectReferences(Object targetObj, params ValueTuple<string, Object>[] properties)
{
for (var i = 0; i < properties.Length; i++)
SetObjectReference(targetObj, properties[i].Item1, properties[i].Item2);