Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Assets/Editor/FindGameObjects/FindGameObjectsTestMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static async void TestFindGameObjectsCamera()

try
{
UnityCliLoopToolResponse response = await tool.ExecuteAsync(parameters);
UnityCliLoopToolResponse response = await tool.ExecuteAsync(parameters, System.Threading.CancellationToken.None);

if (response is FindGameObjectsResponse findResponse)
{
Expand Down Expand Up @@ -69,7 +69,7 @@ public static async void TestFindMainCameraByPath()
try
{
Debug.Log("[FindGameObjectsTestMenu] Executing search for Main Camera...");
UnityCliLoopToolResponse response = await tool.ExecuteAsync(parameters);
UnityCliLoopToolResponse response = await tool.ExecuteAsync(parameters, System.Threading.CancellationToken.None);

if (response is FindGameObjectsResponse findResponse)
{
Expand Down
26 changes: 26 additions & 0 deletions Assets/Tests/Editor/BridgeClientConnectionTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.IO;

using NUnit.Framework;

using io.github.hatayama.UnityCliLoop.Infrastructure;

namespace io.github.hatayama.UnityCliLoop.Tests.Editor
{
public sealed class BridgeClientConnectionTests
{
[Test]
public void IsConnected_WhenConnectionStateProviderIsDisposed_ShouldReturnFalse()
{
using MemoryStream stream = new();
BridgeClientConnection connection = new(
"test-endpoint",
stream,
() => throw new ObjectDisposedException("test-client"));

bool isConnected = connection.IsConnected;

Assert.That(isConnected, Is.False);
}
}
}
11 changes: 11 additions & 0 deletions Assets/Tests/Editor/BridgeClientConnectionTests.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

namespace io.github.hatayama.UnityCliLoop.Tests.Editor
{
public class CompilationLockFileServiceTests
public class CompilationReadinessStatePublisherTests
{
private ServerReadinessStateStore _stateStore;
private CompilationLockFileService _service;
private CompilationReadinessStatePublisher _service;

[SetUp]
public void SetUp()
{
_stateStore = CreateTestStateStore();
_service = new CompilationLockFileService(_stateStore);
_service = new CompilationReadinessStatePublisher(_stateStore);
}

[TearDown]
Expand Down
42 changes: 21 additions & 21 deletions Assets/Tests/Editor/FindGameObjectsToolTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async Task ExecuteAsync_WithNamePattern_FindsMatchingObjects()
};

// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand All @@ -80,7 +80,7 @@ public async Task ExecuteAsync_WithEmptyParameters_ReturnsError()
JObject paramsJson = new();

// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand All @@ -103,7 +103,7 @@ public async Task ExecuteAsync_WithComponentSearch_FindsObjectsWithSpecificCompo
};

// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand All @@ -130,7 +130,7 @@ public async Task ExecuteAsync_WithMultipleComponentSearch_FindsObjectsWithAllCo
};

// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down Expand Up @@ -162,7 +162,7 @@ public async Task ExecuteAsync_WithTagSearch_FindsObjectsWithSpecificTag()
};

// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down Expand Up @@ -198,7 +198,7 @@ public async Task ExecuteAsync_WithLayerSearch_FindsObjectsOnSpecificLayer()
};

// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down Expand Up @@ -230,7 +230,7 @@ public async Task ExecuteAsync_WithRegexSearch_FindsObjectsMatchingPattern()
try
{
// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down Expand Up @@ -266,7 +266,7 @@ public async Task ExecuteAsync_WithIncludeInactive_FindsInactiveObjects()
};

// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down Expand Up @@ -294,7 +294,7 @@ public async Task ExecuteAsync_WithoutIncludeInactive_ExcludesInactiveObjects()
};

// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down Expand Up @@ -322,7 +322,7 @@ public async Task ExecuteAsync_WithComplexSearch_CombinesMultipleCriteria()
};

// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down Expand Up @@ -356,7 +356,7 @@ public async Task ExecuteAsync_WithMaxResults_LimitsReturnedObjects()
try
{
// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down Expand Up @@ -398,7 +398,7 @@ public async Task ExecuteAsync_WithPathSearchMode_FindsObjectByHierarchyPath()
try
{
// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down Expand Up @@ -430,7 +430,7 @@ public async Task ExecuteAsync_WithExactSearchMode_FindsExactNameMatch()
try
{
// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down Expand Up @@ -463,7 +463,7 @@ public async Task ExecuteAsync_WithContainsSearchMode_FindsPartialMatch()
try
{
// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down Expand Up @@ -495,7 +495,7 @@ public async Task ExecuteAsync_WithSelectedMode_NoSelection_ReturnsEmptyResult()
};

// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand All @@ -519,7 +519,7 @@ public async Task ExecuteAsync_WithSelectedMode_SingleSelection_ReturnsJsonDirec
try
{
// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down Expand Up @@ -549,7 +549,7 @@ public async Task ExecuteAsync_WithSelectedMode_MultipleSelection_ExportsToFile(
try
{
// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down Expand Up @@ -591,7 +591,7 @@ public async Task ExecuteAsync_WithSelectedMode_IncludeInactiveFalse_ExcludesIna
try
{
// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down Expand Up @@ -625,7 +625,7 @@ public async Task ExecuteAsync_ReturnsObjectReferenceProperties()
try
{
// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down Expand Up @@ -667,7 +667,7 @@ public async Task ExecuteAsync_ReturnsNoneForUnsetObjectReference()
};

// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down Expand Up @@ -716,7 +716,7 @@ public async Task ExecuteAsync_WithSelectedMode_IncludeInactiveTrue_IncludesInac
try
{
// Act
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson);
UnityCliLoopToolResponse baseResponse = await tool.ExecuteAsync(paramsJson, System.Threading.CancellationToken.None);
FindGameObjectsResponse response = baseResponse as FindGameObjectsResponse;

// Assert
Expand Down
6 changes: 3 additions & 3 deletions Assets/Tests/Editor/GetHierarchyToolTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public async Task ExecuteAsync_WithDefaultParameters_ReturnsHierarchyExport()
// Tests that the bundled hierarchy tool executes without host-service injection.
JObject parameters = new();

UnityCliLoopToolResponse baseResponse = await _tool.ExecuteAsync(parameters);
UnityCliLoopToolResponse baseResponse = await _tool.ExecuteAsync(parameters, System.Threading.CancellationToken.None);
GetHierarchyResponse response = baseResponse as GetHierarchyResponse;

Assert.That(response, Is.Not.Null);
Expand All @@ -51,7 +51,7 @@ public async Task ExecuteAsync_WithMaxDepthParameter_MapsRequest()
["MaxDepth"] = 1
};

UnityCliLoopToolResponse baseResponse = await _tool.ExecuteAsync(parameters);
UnityCliLoopToolResponse baseResponse = await _tool.ExecuteAsync(parameters, System.Threading.CancellationToken.None);
GetHierarchyResponse response = baseResponse as GetHierarchyResponse;

Assert.That(response, Is.Not.Null);
Expand All @@ -66,7 +66,7 @@ public async Task ExecuteAsync_WithIncludeComponentsFalse_MapsRequest()
["IncludeComponents"] = false
};

UnityCliLoopToolResponse baseResponse = await _tool.ExecuteAsync(parameters);
UnityCliLoopToolResponse baseResponse = await _tool.ExecuteAsync(parameters, System.Threading.CancellationToken.None);
GetHierarchyResponse response = baseResponse as GetHierarchyResponse;

Assert.That(response, Is.Not.Null);
Expand Down
Loading
Loading