Skip to content

Commit

Permalink
Fixed tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
artempushkin committed Oct 19, 2023
1 parent 7048507 commit fae9ea0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Hosting.Services/HostBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ private static IHost BuildServiceFabricService<TRunner, TService, TContext>(
builderAction(new ServiceFabricHostBuilder<TService, TContext>(builder));

IHost host = builder
.ConfigureLogging(builder => builder.AddOmexLogging())
.ConfigureServices((context, collection) =>
{
collection
Expand All @@ -102,6 +101,7 @@ private static IHost BuildServiceFabricService<TRunner, TService, TContext>(
options.ValidateOnBuild = true;
options.ValidateScopes = true;
})
.ConfigureLogging(builder => builder.AddOmexLogging())
.Build();

InitializationLogger.LogInitializationSucceed(serviceNameForLogging);
Expand Down
2 changes: 2 additions & 0 deletions src/Logging/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ public static ILoggingBuilder AddOmexLogging(this ILoggingBuilder builder)
/// <returns>The <see cref="IServiceCollection"/> so that additional calls can be chained</returns>
public static IServiceCollection AddOmexLogging(this IServiceCollection serviceCollection)
{
serviceCollection.AddLogging();

serviceCollection.TryAddTransient<IServiceContext, EmptyServiceContext>();
serviceCollection.TryAddTransient<IExecutionContext, BaseExecutionContext>();
serviceCollection.TryAddTransient<IExternalScopeProvider, LoggerExternalScopeProvider>();
Expand Down
1 change: 0 additions & 1 deletion tests/Activities.UnitTests/ServiceCollectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public void AddOmexActivitySource_HostedServicesRegistered()
{
Type[] types = GetRegisteredServices<IHostedService>();

Assert.AreEqual(2, types.Length);
CollectionAssert.Contains(types, typeof(ActivityListenerInitializerService));
CollectionAssert.Contains(types, typeof(DiagnosticsObserversInitializer));
}
Expand Down

0 comments on commit fae9ea0

Please sign in to comment.