Skip to content

Commit

Permalink
Fixed code style issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmg committed Oct 27, 2018
1 parent 51a0931 commit 78c8f9a
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions test/Autofac.Integration.ServiceFabric.Test/Assertions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,26 @@ internal static void AssertRegistered<TService>(this IComponentContext context)

internal static void AssertSharing<TComponent>(this IComponentContext context, InstanceSharing sharing)
{
var cr = context.RegistrationFor<TComponent>();
Assert.Equal(sharing, cr.Sharing);
var registration = context.RegistrationFor<TComponent>();
Assert.Equal(sharing, registration.Sharing);
}

internal static void AssertLifetime<TComponent, TLifetime>(this IComponentContext context)
{
var cr = context.RegistrationFor<TComponent>();
Assert.IsType<TLifetime>(cr.Lifetime);
var registration = context.RegistrationFor<TComponent>();
Assert.IsType<TLifetime>(registration.Lifetime);
}

internal static void AssertOwnership<TComponent>(this IComponentContext context, InstanceOwnership ownership)
{
var cr = context.RegistrationFor<TComponent>();
Assert.Equal(ownership, cr.Ownership);
var registration = context.RegistrationFor<TComponent>();
Assert.Equal(ownership, registration.Ownership);
}

internal static IComponentRegistration RegistrationFor<TComponent>(this IComponentContext context)
{
IComponentRegistration r;
Assert.True(context.ComponentRegistry.TryGetRegistration(new TypedService(typeof(TComponent)), out r));
return r;
Assert.True(context.ComponentRegistry.TryGetRegistration(new TypedService(typeof(TComponent)), out var registration));
return registration;
}
}
}

0 comments on commit 78c8f9a

Please sign in to comment.