-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes DataStores back to Scoped (#562)
* Changes DataStores back to Scoped - moves lifetime ownership to highest level components * Adds Func<IScoped<ISearchService>> resolution * Adds Func<IScoped<IFhirDataStore>>
- Loading branch information
1 parent
c8cfcd0
commit a433fbd
Showing
11 changed files
with
156 additions
and
136 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
src/Microsoft.Health.Fhir.Core.UnitTests/Extensions/CreateMockedScopeExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// ------------------------------------------------------------------------------------------------- | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. | ||
// ------------------------------------------------------------------------------------------------- | ||
|
||
using Microsoft.Health.Extensions.DependencyInjection; | ||
using NSubstitute; | ||
|
||
namespace Microsoft.Health.Fhir.Core.UnitTests.Extensions | ||
{ | ||
public static class CreateMockedScopeExtensions | ||
{ | ||
public static IScoped<T> CreateMockScope<T>(this T obj) | ||
{ | ||
var scope = Substitute.For<IScoped<T>>(); | ||
scope.Value.Returns(obj); | ||
return scope; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.