Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
8d14b0c
Reorganize source code in preparation to move into aspnet/Extensions
Nov 2, 2018
3f330b6
Merge the source code from aspnet/DependencyInjection release/2.1
Nov 2, 2018
7a9b875
Handle nullable enum default values (dotnet/Extensions#531)
pakrym Nov 16, 2018
5a99e9b
Use Arcade (dotnet/Extensions#586)
ryanbrandenburg Jan 29, 2019
a0f9369
Cleanup conversion to Arcade (dotnet/Extensions#1014)
natemcmaster Jan 30, 2019
2adbe11
Remove implicit references for non-test projects (dotnet/Extensions#1…
natemcmaster Jan 31, 2019
678640f
Add reference assembly generations support (dotnet/Extensions#1093)
pakrym Feb 11, 2019
d498fdf
Fixes aspnet/Extensionsdotnet/Extensions#1503 (dotnet/Extensions#1504)
ENikS Apr 23, 2019
c6690db
Add support for source-build (dotnet/Extensions#1740)
natemcmaster May 23, 2019
3b86e56
Use even more Arcade and other csproj cleanups (dotnet/Extensions#1833)
natemcmaster Jun 13, 2019
ae0b649
Added verification test for resolving singleton from scoped container…
davidfowl Aug 28, 2019
db6499a
Normalize all file headers to the expected Apache 2.0 license
sharwell Feb 26, 2020
b27f989
Switch file headers to the MIT license
sharwell Feb 26, 2020
0463a4b
Merge branch 'fromoldmaster-di-spec' of Extensions repo into fromoldm…
maryamariyan Mar 17, 2020
7f4ec6a
Update src/libraries/Microsoft.Extensions.DependencyInjection/tests/D…
maryamariyan Mar 17, 2020
03bedd8
Update src/libraries/Microsoft.Extensions.DependencyInjection/tests/D…
maryamariyan Mar 18, 2020
a2e87f1
Remove DI.Specification csproj
maryamariyan Mar 18, 2020
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

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes
{
public class AnotherClass
{
public AnotherClass(IFakeService fakeService)
{
FakeService = fakeService;
}

public IFakeService FakeService { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes
{
public class AnotherClassAcceptingData
{
public AnotherClassAcceptingData(IFakeService fakeService, string one, string two)
{
FakeService = fakeService;
One = one;
Two = two;
}

public IFakeService FakeService { get; }

public string One { get; }

public string Two { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes
{
public class ClassWithAmbiguousCtors
{
public ClassWithAmbiguousCtors(string data)
{
CtorUsed = "string";
}

public ClassWithAmbiguousCtors(IFakeService service, string data)
{
CtorUsed = "IFakeService, string";
}

public ClassWithAmbiguousCtors(IFakeService service, int data)
{
CtorUsed = "IFakeService, int";
}

public ClassWithAmbiguousCtors(IFakeService service, string data1, int data2)
{
FakeService = service;
Data1 = data1;
Data2 = data2;

CtorUsed = "IFakeService, string, string";
}

public IFakeService FakeService { get; }

public string Data1 { get; }

public int Data2 { get; }
public string CtorUsed { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes
{
public class ClassWithAmbiguousCtorsAndAttribute
{
public ClassWithAmbiguousCtorsAndAttribute(string data)
{
CtorUsed = "string";
}

[ActivatorUtilitiesConstructor]
public ClassWithAmbiguousCtorsAndAttribute(IFakeService service, string data)
{
CtorUsed = "IFakeService, string";
}

public ClassWithAmbiguousCtorsAndAttribute(IFakeService service, IFakeOuterService service2, string data)
{
CtorUsed = "IFakeService, IFakeService, string";
}

public string CtorUsed { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.Extensions.DependencyInjection
{
public class ClassWithInternalConstructor
{
internal ClassWithInternalConstructor()
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes
{
public class ClassWithMultipleMarkedCtors
{
[ActivatorUtilitiesConstructor]
public ClassWithMultipleMarkedCtors(string data)
{
}

[ActivatorUtilitiesConstructor]
public ClassWithMultipleMarkedCtors(IFakeService service, string data)
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;

namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes
{
public class ClassWithNestedReferencesToProvider : IDisposable
{
private IServiceProvider _serviceProvider;
private ClassWithNestedReferencesToProvider _nested;

public ClassWithNestedReferencesToProvider(IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
_nested = new ClassWithNestedReferencesToProvider(_serviceProvider, 0);
}

private ClassWithNestedReferencesToProvider(IServiceProvider serviceProvider, int level)
{
_serviceProvider = serviceProvider;
if (level > 1)
{
_nested = new ClassWithNestedReferencesToProvider(_serviceProvider, level + 1);
}
}

public void Dispose()
{
_nested?.Dispose();
(_serviceProvider as IDisposable)?.Dispose();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.Extensions.DependencyInjection.Specification
{
public class ClassWithOptionalArgsCtor
{
public ClassWithOptionalArgsCtor(string whatever = "BLARGH")
{
Whatever = whatever;
}

public string Whatever { get; set; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;

namespace Microsoft.Extensions.DependencyInjection.Specification
{
public class ClassWithOptionalArgsCtorWithStructs
{
public ConsoleColor? Color { get; }
public ConsoleColor? ColorNull { get; }

public int? Integer { get; }
public int? IntegerNull { get; }

public ClassWithOptionalArgsCtorWithStructs(
DateTime dateTime = new DateTime(),
DateTime dateTimeDefault = default(DateTime),
TimeSpan timeSpan = new TimeSpan(),
TimeSpan timeSpanDefault = default(TimeSpan),
DateTimeOffset dateTimeOffset = new DateTimeOffset(),
DateTimeOffset dateTimeOffsetDefault = default(DateTimeOffset),
Guid guid = new Guid(),
Guid guidDefault = default(Guid),
CustomStruct customStruct = new CustomStruct(),
CustomStruct customStructDefault = default(CustomStruct),
ConsoleColor? color = ConsoleColor.DarkGreen,
ConsoleColor? colorNull = null,
int? integer = 12,
int? integerNull = null
)
{
Color = color;
ColorNull = colorNull;
Integer = integer;
IntegerNull = integerNull;
}

public struct CustomStruct { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes
{
public class ClassWithPrivateCtor
{
private ClassWithPrivateCtor()
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes
{
public class ClassWithProtectedConstructor
{
internal ClassWithProtectedConstructor()
{
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.Collections.Generic;
using System.Text;

namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes
{
public class ClassWithServiceProvider
{
public ClassWithServiceProvider(IServiceProvider serviceProvider)
{
ServiceProvider = serviceProvider;
}

public IServiceProvider ServiceProvider { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes
{
public class ClassWithStaticCtor
{
static ClassWithStaticCtor()
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;

namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes
{
public class ClassWithThrowingCtor
{
public ClassWithThrowingCtor(IFakeService service)
{
throw new Exception(nameof(ClassWithThrowingCtor));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;

namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes
{
public class ClassWithThrowingEmptyCtor
{
public ClassWithThrowingEmptyCtor()
{
throw new Exception(nameof(ClassWithThrowingEmptyCtor));
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes
{
public class CreationCountFakeService
{
public static readonly object InstanceLock = new object();

public CreationCountFakeService(IFakeService dependency)
{
InstanceCount++;
InstanceId = InstanceCount;
}

public static int InstanceCount { get; set; }

public int InstanceId { get; }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes
{
public class FakeDisposableCallbackInnerService : FakeDisposableCallbackService, IFakeMultipleService
{
public FakeDisposableCallbackInnerService(FakeDisposeCallback callback) : base(callback)
{
}
}
}
Loading