<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
- <TargetFrameworks>$(DefaultNetCoreTargetFramework);net472</TargetFrameworks>
- <RootNamespace>Microsoft.Extensions.DependencyInjection</RootNamespace>
- <SignAssembly>false</SignAssembly>
+ <TargetFrameworks>$(NetCoreAppCurrent);$(NetFrameworkCurrent)</TargetFrameworks>
+ <EnableDefaultItems>true</EnableDefaultItems>
+ <NoWarn>$(NoWarn);CS8002</NoWarn>
+ <SignAssembly Condition="$(TargetFramework.StartsWith('net4'))">false</SignAssembly>
</PropertyGroup>
<ItemGroup>
- <Reference Include="Newtonsoft.Json" />
-
- <Reference Include="Microsoft.Extensions.DependencyInjection.Abstractions" />
- <Reference Include="Microsoft.Extensions.DependencyInjection.Specification.Tests" />
- <Reference Include="Microsoft.Extensions.DependencyInjection" />
-
- <Reference Include="Autofac.Extensions.DependencyInjection" />
- <Reference Include="DryIoc.Microsoft.DependencyInjection" />
- <Reference Include="Lamar.Microsoft.DependencyInjection" />
- <Reference Include="LightInject.Microsoft.DependencyInjection" />
- <Reference Include="StructureMap.Microsoft.DependencyInjection" />
- <Reference Include="Grace.DependencyInjection.Extensions" />
- <Reference Include="Stashbox.Extensions.Dependencyinjection" />
- <Reference Include="Unity.Microsoft.DependencyInjection" />
+ <Compile Include="$(CommonTestPath)Extensions\TestingUtils\Microsoft.AspNetCore.Testing\src\ExceptionAssertions.cs"
+ Link="Common\tests\Extensions\TestingUtils\Microsoft.AspNetCore.Testing\src\ExceptionAssertions.cs" />
+ <Compile Include="$(CommonTestPath)Extensions\TestingUtils\Microsoft.AspNetCore.Testing\src\CultureReplacer.cs"
+ Link="Common\tests\Extensions\TestingUtils\Microsoft.AspNetCore.Testing\src\CultureReplacer.cs" />
+ <Compile Include="..\DI.Specification.Tests\**\*.cs" />
</ItemGroup>
<ItemGroup>
- <None Update="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
+ <ReferenceFromRuntime Include="Microsoft.Extensions.DependencyInjection" />
+ <ReferenceFromRuntime Include="Microsoft.Extensions.DependencyInjection.Abstractions" Aliases="DIAbstractions" />
+ <PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
+ <PackageReference Include="Autofac.Extensions.DependencyInjection" Version="4.3.1"/>
+ <PackageReference Include="DryIoc.Microsoft.DependencyInjection" Version="2.1.0"/>
+ <PackageReference Include="Lamar.Microsoft.DependencyInjection" Version="2.0.1"/>
+ <PackageReference Include="LightInject.Microsoft.DependencyInjection" Version="2.2.0"/>
+ <PackageReference Include="StructureMap.Microsoft.DependencyInjection" Version="1.4.0"/>
+ <PackageReference Include="Grace.DependencyInjection.Extensions" Version="6.4.0"/>
+ <PackageReference Include="Stashbox.Extensions.Dependencyinjection" Version="2.6.3"/>
+ <PackageReference Include="Unity.Microsoft.DependencyInjection" Version="2.1.3" />
</ItemGroup>
</Project>
namespace Microsoft.Extensions.DependencyInjection.Specification
{
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public abstract partial class DependencyInjectionSpecificationTests
{
public delegate object CreateInstanceFunc(IServiceProvider provider, Type type, object[] args);
[Theory]
[MemberData(nameof(CreateInstanceFuncs))]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void TypeActivatorEnablesYouToCreateAnyTypeWithServicesEvenWhenNotInIocContainer(CreateInstanceFunc createFunc)
{
// Arrange
[Theory]
[MemberData(nameof(CreateInstanceFuncs))]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void TypeActivatorAcceptsAnyNumberOfAdditionalConstructorParametersToProvide(CreateInstanceFunc createFunc)
{
// Arrange
[Theory]
[MemberData(nameof(CreateInstanceFuncs))]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void TypeActivatorCanDisambiguateConstructorsWithUniqueArguments(CreateInstanceFunc createFunc)
{
// Arrange
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void GetServiceOrCreateInstanceRegisteredServiceTransient()
{
// Reset the count because test order is not guaranteed
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void GetServiceOrCreateInstanceRegisteredServiceSingleton()
{
lock (CreationCountFakeService.InstanceLock)
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void GetServiceOrCreateInstanceUnregisteredService()
{
lock (CreationCountFakeService.InstanceLock)
namespace Microsoft.Extensions.DependencyInjection.Specification
{
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public abstract partial class DependencyInjectionSpecificationTests
{
protected abstract IServiceProvider CreateServiceProvider(IServiceCollection serviceCollection);
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void ServicesRegisteredWithImplementationType_ReturnDifferentInstancesPerResolution_ForTransientServices()
{
// Arrange
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void TransientServiceCanBeResolvedFromProvider()
{
// Arrange
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void TransientServiceCanBeResolvedFromScope()
{
// Arrange
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void MultipleServiceCanBeIEnumerableResolved()
{
// Arrange
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void RegistrationOrderIsPreservedWhenServicesAreIEnumerableResolved()
{
// Arrange
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void OuterServiceCanHaveOtherServicesInjected()
{
// Arrange
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void FactoryServicesAreCreatedAsPartOfCreatingObjectGraph()
{
// Arrange
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void LastServiceReplacesPreviousServices()
{
// Arrange
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void ScopedServiceCanBeResolved()
{
// Arrange
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void NestedScopedServiceCanBeResolved()
{
// Arrange
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void ScopedServices_FromCachedScopeFactory_CanBeResolvedAndDisposed()
{
// Arrange
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void DisposingScopeDisposesService()
{
// Arrange
}
[Fact]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void NestedScopedServiceCanBeResolvedWithNoFallbackProvider()
{
// Arrange
[Theory]
[MemberData(nameof(ServiceContainerPicksConstructorWithLongestMatchesData))]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void ServiceContainerPicksConstructorWithLongestMatches(
IServiceCollection serviceCollection,
TypeWithSupersetConstructors expected)
[InlineData(typeof(IFakeService), typeof(FakeService), typeof(IFakeService), ServiceLifetime.Singleton)]
[InlineData(typeof(IFakeOpenGenericService<>), typeof(FakeOpenGenericService<>), typeof(IFakeOpenGenericService<IServiceProvider>), ServiceLifetime.Scoped)]
[InlineData(typeof(IFakeOpenGenericService<>), typeof(FakeOpenGenericService<>), typeof(IFakeOpenGenericService<IServiceProvider>), ServiceLifetime.Singleton)]
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public void ResolvesDifferentInstancesForServiceWhenResolvingEnumerable(Type serviceType, Type implementation, Type resolve, ServiceLifetime lifetime)
{
// Arrange
</PropertyGroup>
<ItemGroup>
- <Compile Include="..\..\Common\tests\Extensions\TestingUtils\Microsoft.AspNetCore.Testing\src\ExceptionAssertions.cs"
+ <Compile Include="$(CommonTestPath)Extensions\TestingUtils\Microsoft.AspNetCore.Testing\src\ExceptionAssertions.cs"
Link="Common\tests\Extensions\TestingUtils\Microsoft.AspNetCore.Testing\src\ExceptionAssertions.cs" />
- <Compile Include="..\..\Common\tests\Extensions\TestingUtils\Microsoft.AspNetCore.Testing\src\CultureReplacer.cs"
+ <Compile Include="$(CommonTestPath)Extensions\TestingUtils\Microsoft.AspNetCore.Testing\src\CultureReplacer.cs"
Link="Common\tests\Extensions\TestingUtils\Microsoft.AspNetCore.Testing\src\CultureReplacer.cs" />
+ <Compile Include="..\DI.Specification.Tests\**\*.cs" />
</ItemGroup>
<ItemGroup>
namespace Microsoft.Extensions.DependencyInjection.Tests
{
+ [ActiveIssue("https://github.com/dotnet/runtime/issues/33894", TestRuntimes.Mono)]
public class ServiceProviderCompilationTest
{
[Theory]