Skip to content

Commit 6bdcd14

Browse files
author
Alessandro Calorì
committed
Fixed solution file. Renamed namespace. Implemented test specification.
1 parent 770dfef commit 6bdcd14

8 files changed

+38
-10
lines changed

package.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
44
VisualStudioVersion = 15.0.27004.2005
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Unity.DependencyInjection", "src\Unity.DependencyInjection.csproj", "{520251C7-14E6-434F-A26E-67E9762635BD}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Unity.DependencyInjection", "src\Unity.Microsoft.DependencyInjection.csproj", "{520251C7-14E6-434F-A26E-67E9762635BD}"
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{DA61FEC3-1E17-4DCF-AC19-A6482A547741}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DependencyInjection.Tests", "tests\DependencyInjection.Tests.csproj", "{FCC3DAA4-9136-4C55-926D-7DBD5BEDE8D8}"
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DependencyInjection.Tests", "tests\Microsoft.DependencyInjection.Tests.csproj", "{FCC3DAA4-9136-4C55-926D-7DBD5BEDE8D8}"
1111
EndProject
1212
Global
1313
GlobalSection(SolutionConfigurationPlatforms) = preSolution

src/Configuration.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
using Unity.Injection;
99
using Unity.Lifetime;
1010

11-
namespace Unity.DependencyInjection
11+
namespace Unity.Microsoft.DependencyInjection
1212
{
1313
public static class Configuration
1414
{

src/ServiceProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System;
22

3-
namespace Unity.DependencyInjection
3+
namespace Unity.Microsoft.DependencyInjection
44
{
55
public class ServiceProvider : IServiceProvider
66
{

src/ServiceScope.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
using Microsoft.Extensions.DependencyInjection;
44

5-
namespace Unity.DependencyInjection
5+
namespace Unity.Microsoft.DependencyInjection
66
{
77
public class ServiceScope : IServiceScope
88
{

src/ServiceScopeFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Microsoft.Extensions.DependencyInjection;
22

3-
namespace Unity.DependencyInjection
3+
namespace Unity.Microsoft.DependencyInjection
44
{
55
public class ServiceScopeFactory : IServiceScopeFactory
66
{

src/Unity.Microsoft.DependencyInjection.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<RepositoryType>git</RepositoryType>
2121
<Authors>Microsoft.Practices.Unity</Authors>
2222
<Company>Microsoft.Practices.Unity</Company>
23-
<RootNamespace>Unity.DependencyInjection</RootNamespace>
23+
<RootNamespace>Unity.Microsoft.DependencyInjection</RootNamespace>
2424
<UnityAbstractions>..\..\Abstractions\src\Unity.Abstractions.csproj</UnityAbstractions>
2525
<UnityContainer>..\..\Container\src\Unity.Container.csproj</UnityContainer>
2626
</PropertyGroup>

tests/Microsoft.DependencyInjection.Tests.csproj

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
<PropertyGroup>
44
<TargetFramework>net47</TargetFramework>
55
<IsPackable>false</IsPackable>
6+
<RootNamespace>Unity.Microsoft.DependencyInjection.Tests</RootNamespace>
67
</PropertyGroup>
78

89
<ItemGroup>
9-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0-preview-20171012-09" />
10-
<PackageReference Include="MSTest.TestAdapter" Version="1.2.0" />
11-
<PackageReference Include="MSTest.TestFramework" Version="1.2.0" />
10+
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Specification.Tests" Version="1.1.1" />
11+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
12+
<PackageReference Include="xunit" Version="2.3.1" />
13+
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
1214
</ItemGroup>
1315

1416
<ItemGroup>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
3+
using Microsoft.Extensions.DependencyInjection;
4+
using Microsoft.Extensions.DependencyInjection.Specification;
5+
6+
namespace Unity.Microsoft.DependencyInjection.Tests
7+
{
8+
public sealed class UnityDependencyInjectionTests : DependencyInjectionSpecificationTests
9+
{
10+
/// <inheritdoc />
11+
protected override IServiceProvider CreateServiceProvider(IServiceCollection serviceCollection)
12+
{
13+
var container = new UnityContainer();
14+
var provider = new ServiceProvider(container);
15+
16+
foreach (ServiceDescriptor service in serviceCollection)
17+
{
18+
container.RegisterType(
19+
service.ServiceType,
20+
service.ImplementationType);
21+
}
22+
23+
return provider;
24+
}
25+
}
26+
}

0 commit comments

Comments
 (0)