using Xunit; using FluentAssertions; using NSubstitute; using FreeCode.Commands; using FreeCode.Core.Enums; using FreeCode.Core.Models; using FreeCode.Tests.Unit.Helpers; namespace FreeCode.Tests.Unit.Commands; public sealed class ExitCommandTests { [Fact] public void ExitCommand_ExposesExpectedMetadata() { var command = new ExitCommand(); command.Name.Should().Be("exit"); command.Aliases.Should().Equal("quit"); command.Description.Should().Be("Exit the application."); } [Fact] public async Task ExecuteAsync_ReturnsSuccessfulExitResult() { var command = new ExitCommand(); var result = await command.ExecuteAsync(new CommandContext(Environment.CurrentDirectory, new SimpleServiceProvider())); result.Success.Should().BeTrue(); result.Output.Should().Be("Exit requested."); } [Fact] public void ExitCommand_UsesLocalCategoryAndAlwaysAvailability() { var command = new ExitCommand(); command.Category.Should().Be(CommandCategory.Local); command.Availability.Should().Be(CommandAvailability.Always); command.IsEnabled().Should().BeTrue(); } }