Skip to main content
Glama

Azure MCP Server

Official
MIT License
1,161
  • Linux
  • Apple
MySqlServiceTests.cs1.89 kB
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using AzureMcp.Core.Services.Azure.ResourceGroup; using AzureMcp.Core.Services.Azure.Tenant; using AzureMcp.MySql.Services; using Microsoft.Extensions.Logging; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; namespace AzureMcp.MySql.UnitTests.Services; public class MySqlServiceTests { private readonly IResourceGroupService _resourceGroupService; private readonly ITenantService _tenantService; private readonly ILogger<MySqlService> _logger; private readonly MySqlService _mysqlService; public MySqlServiceTests() { _resourceGroupService = Substitute.For<IResourceGroupService>(); _tenantService = Substitute.For<ITenantService>(); _logger = Substitute.For<ILogger<MySqlService>>(); _mysqlService = new MySqlService(_resourceGroupService, _tenantService, _logger); } [Fact] public void Constructor_WithNullResourceGroupService_ThrowsArgumentNullException() { Assert.Throws<ArgumentNullException>(() => new MySqlService(null!, _tenantService, _logger)); } [Fact] public void Constructor_WithValidDependencies_CreatesInstance() { var service = new MySqlService(_resourceGroupService, _tenantService, _logger); Assert.NotNull(service); } [Fact] public async Task ListServersAsync_WhenResourceGroupServiceThrows_RethrowsException() { var exception = new InvalidOperationException("Resource group not found"); _resourceGroupService.GetResourceGroupResource("sub123", "rg1").ThrowsAsync(exception); var thrownException = await Assert.ThrowsAsync<InvalidOperationException>(() => _mysqlService.ListServersAsync("sub123", "rg1", "user1")); Assert.Equal(exception, thrownException); } }

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