Skip to content

Commit 6f11055

Browse files
committed
Rename test class and remove ProxyCommand tests
Renamed CommandHelpersAndProxyTests to CommandHelpersTests. Removed all ProxyCommand-related tests and cleaned up unused using directives for improved clarity and maintainability. #60
1 parent 19e07cf commit 6f11055

1 file changed

Lines changed: 1 addition & 48 deletions

File tree

tests/SynentraCtl.UnitTests/Commands/CommandHelpersAndProxyTests.cs renamed to tests/SynentraCtl.UnitTests/Commands/CommandHelpersTests.cs

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
using FluentAssertions;
2-
using Microsoft.Extensions.DependencyInjection;
32
using NSubstitute;
4-
using System.CommandLine;
5-
using Synentra.Client.Abstractions;
63
using SynentraCtl.Commands;
74
using SynentraCtl.Core.Services.Docker;
85
using SynentraCtl.Core.Services.Extractor;
96
using SynentraCtl.Core.Services.Location;
10-
using SynentraCtl.Core.Services.Logger;
117

128
namespace SynentraCtl.UnitTests.Commands;
139

14-
public class CommandHelpersAndProxyTests
10+
public class CommandHelpersTests
1511
{
1612
[Fact]
1713
public void IsNewerVersion_ParsedVersions_ReturnsExpectedResult()
@@ -157,47 +153,4 @@ public void ExtractAssetToRoot_ExtractsToRootAndDeletesStaging()
157153
if (Directory.Exists(root)) Directory.Delete(root, true);
158154
}
159155
}
160-
161-
[Fact]
162-
public async Task ProxyCommand_Create_InvokedWithHeaders_WritesResponse()
163-
{
164-
var services = new ServiceCollection();
165-
var logger = Substitute.For<ISynentraCtlLogger>();
166-
var client = Substitute.For<ISynentraClient>();
167-
services.AddSingleton(logger);
168-
services.AddSingleton(client);
169-
var provider = services.BuildServiceProvider();
170-
171-
var command = ProxyCommand.Create(provider);
172-
await command.Parse([
173-
"--method", "POST",
174-
"--path", "/health",
175-
"--body", "{}",
176-
"--header", "Authorization:Bearer token",
177-
"--header", "InvalidHeader",
178-
"--header", "X-Test:123"
179-
]).InvokeAsync();
180-
181-
logger.Received().Write(Arg.Any<string>());
182-
}
183-
184-
[Fact]
185-
public async Task ProxyCommand_WhitespacePath_WritesError()
186-
{
187-
var services = new ServiceCollection();
188-
var logger = Substitute.For<ISynentraCtlLogger>();
189-
var client = Substitute.For<ISynentraClient>();
190-
services.AddSingleton(logger);
191-
services.AddSingleton(client);
192-
var provider = services.BuildServiceProvider();
193-
194-
var command = ProxyCommand.Create(provider);
195-
await command.Parse([
196-
"--path", " ",
197-
"--body", "{}",
198-
"--header", "A:1"
199-
]).InvokeAsync();
200-
201-
logger.Received().WriteError(Arg.Any<string>());
202-
}
203156
}

0 commit comments

Comments
 (0)