Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Gamache committed Jun 21, 2024
1 parent ecc1cb4 commit 51872a9
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
using Workleap.AspNetCore.Authentication.ClientCredentialsGrant.Swagger;
using Workleap.AspNetCore.Authentication.ClientCredentialsGrant.OpenAPI;

// ReSharper disable once CheckNamespace
namespace Microsoft.Extensions.DependencyInjection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;

namespace Workleap.AspNetCore.Authentication.ClientCredentialsGrant.Swagger;
namespace Workleap.AspNetCore.Authentication.ClientCredentialsGrant.OpenAPI;

internal sealed class SecurityDefinitionDocumentFilter : IDocumentFilter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.WebUtilities;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Primitives;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;

namespace Workleap.AspNetCore.Authentication.ClientCredentialsGrant.Swagger;
namespace Workleap.AspNetCore.Authentication.ClientCredentialsGrant.OpenAPI;

internal sealed class SecurityRequirementOperationFilter : IOperationFilter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Swashbuckle.AspNetCore.SwaggerGen;

namespace Workleap.AspNetCore.Authentication.ClientCredentialsGrant.Swagger;
namespace Workleap.AspNetCore.Authentication.ClientCredentialsGrant.OpenAPI;

internal static class SwaggerUtils
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
using CliWrap;

namespace Workleap.Authentication.ClientCredentialsGrant.Tests.Swagger;
namespace Workleap.Authentication.ClientCredentialsGrant.Tests.OpenAPI;

public class OpenApiSecurityDescriptionTests
{
[Fact]
public async Task TestGeneratedFileMatchesExpectedAsync()
public async Task Given_API_With_Client_Credential_Attribute_When_Generating_OpenAPI_Then_Equal_Expected_Document()
{
var solutionPath = GetSolutionPath();

// Define the paths
var testsFolder = Path.Combine(solutionPath, "tests");
var projectFolder = Path.Combine(testsFolder, "WebApi.OpenAPI.SystemTest");
var generatedFilePath = Path.Combine(projectFolder, "openapi-v1.yaml");
Expand Down Expand Up @@ -40,7 +39,7 @@ private static string GetSolutionPath()
var assemblyLocation = System.Reflection.Assembly.GetExecutingAssembly().Location;
var assemblyDirectory = Path.GetDirectoryName(assemblyLocation);

var solutionDirectory = Directory.GetParent(assemblyDirectory).Parent.Parent.Parent.FullName;
var solutionDirectory = Directory.GetParent(assemblyDirectory!)!.Parent!.Parent!.Parent!.FullName;

return solutionDirectory;
}
Expand Down

0 comments on commit 51872a9

Please sign in to comment.