Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Workleap.Extensions.MediatR.Analyzers.Internals;
namespace Workleap.Extensions.MediatR.Analyzers.Internals;

internal static class KnownSymbolNames
{
Expand All @@ -8,7 +8,7 @@ internal static class KnownSymbolNames
public const string WorkleapExtMediatRAssembly = "Workleap.Extensions.MediatR";

public const string ServiceCollectionInterface = "Microsoft.Extensions.DependencyInjection.IServiceCollection";
public const string ServiceCollectionExtensionsClass = "Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions";
public const string MediatRServiceCollectionExtensionsClass = "Microsoft.Extensions.DependencyInjection.MediatRServiceCollectionExtensions";
public const string WorkleapMediatorExtensionsClass = "MediatR.MediatorExtensions";

public const string BaseRequestInterface = "MediatR.IBaseRequest";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Immutable;
using System.Collections.Immutable;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using Microsoft.CodeAnalysis.Operations;
Expand Down Expand Up @@ -44,7 +44,7 @@ private sealed class AnalyzerImplementation
public AnalyzerImplementation(Compilation compilation)
{
this._serviceCollectionType = compilation.GetBestTypeByMetadataName(KnownSymbolNames.ServiceCollectionInterface, KnownSymbolNames.MsExtDIAbstractionsAssembly)!;
this._serviceCollectionExtensionsType = compilation.GetBestTypeByMetadataName(KnownSymbolNames.ServiceCollectionExtensionsClass, KnownSymbolNames.MediatRAssembly)!;
this._serviceCollectionExtensionsType = compilation.GetBestTypeByMetadataName(KnownSymbolNames.MediatRServiceCollectionExtensionsClass, KnownSymbolNames.MediatRAssembly)!;
}

public bool IsValid => this._serviceCollectionExtensionsType != null;
Expand Down
6 changes: 6 additions & 0 deletions src/Workleap.Extensions.MediatR.Tests/HostBuilderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

namespace Workleap.Extensions.MediatR.Tests;
public sealed class HostBuilderTests
Expand All @@ -11,6 +12,11 @@ public sealed class HostBuilderTests
public async Task SetLicenseFromConfiguration()
{
var builder = WebApplication.CreateBuilder();
builder.Host.UseDefaultServiceProvider(options =>
{
options.ValidateOnBuild = false;
});

builder.Services.AddMediator(typeof(HostBuilderTests).Assembly);
builder.Configuration.AddInMemoryCollection([KeyValuePair.Create<string, string?>("MEDIATR_LICENSE_KEY", "License")]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="MediatR" Version="13.0.0" />
<PackageReference Include="MediatR" Version="13.1.0" />
<PackageReference Include="MediatR.Contracts" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="2.3.0" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="3.3.4">
Expand Down
Loading