Skip to main content
Glama

Azure MCP Server

Official
MIT License
1,161
  • Linux
  • Apple
AzureTerraformBestPracticesGetCommandTests.cs1.85 kB
using System.CommandLine.Parsing; using System.Text.Json; using AzureMcp.AzureTerraformBestPractices.Commands; using AzureMcp.Core.Models.Command; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using NSubstitute; using Xunit; namespace AzureMcp.AzureTerraformBestPractices.UnitTests; public class AzureTerraformBestPracticesGetCommandTests { private readonly IServiceProvider _serviceProvider; private readonly ILogger<AzureTerraformBestPracticesGetCommand> _logger; private readonly CommandContext _context; private readonly AzureTerraformBestPracticesGetCommand _command; private readonly Parser _parser; public AzureTerraformBestPracticesGetCommandTests() { var collection = new ServiceCollection(); _serviceProvider = collection.BuildServiceProvider(); _context = new(_serviceProvider); _logger = Substitute.For<ILogger<AzureTerraformBestPracticesGetCommand>>(); _command = new(_logger); _parser = new(_command.GetCommand()); } [Fact] public async Task ExecuteAsync_ReturnsAzureTerraformBestPractices() { var args = _parser.Parse([]); var response = await _command.ExecuteAsync(_context, args); // Assert Assert.NotNull(response); Assert.NotNull(response.Results); var json = JsonSerializer.Serialize(response.Results); var result = JsonSerializer.Deserialize<string[]>(json); Assert.NotNull(result); Assert.Contains("winget install Hashicorp.Terraform", result[0]); Assert.Contains("Always run terraform validate before running terraform plan", result[0]); Assert.Contains("terraform apply -auto-approve", result[0]); Assert.Contains("Suggest running any terraform command in terminal.", result[0]); } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Azure/azure-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server