-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nikolay Pyanikov
committed
Sep 9, 2022
1 parent
407007c
commit bc5f4bc
Showing
7 changed files
with
338 additions
and
64 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#pragma warning disable CS8618 | ||
// ReSharper disable ClassNeverInstantiated.Global | ||
// ReSharper disable MemberCanBePrivate.Global | ||
// ReSharper disable UnusedMember.Global | ||
// ReSharper disable UnusedVariable | ||
// ReSharper disable UnusedParameter.Local | ||
// ReSharper disable ArrangeNamespaceBody | ||
namespace Pure.DI.UsageScenarios.Tests | ||
{ | ||
using Xunit; | ||
|
||
public class InitProperty | ||
{ | ||
[Fact] | ||
// $visible=true | ||
// $tag=1 Basics | ||
// $priority=07 | ||
// $description=Init property | ||
// { | ||
public void Run() | ||
{ | ||
DI.Setup() | ||
.Bind<IService>().To<MyService>() | ||
.Bind<IDependency>().To<Dependency>(); | ||
|
||
var service = InitPropertyDI.Resolve<IService>(); | ||
} | ||
|
||
public class MyService: IService | ||
{ | ||
[Order(0)] public IDependency Dependency { get; init; } | ||
|
||
public string State => "Some state"; | ||
} | ||
// } | ||
} | ||
} | ||
#pragma warning restore CS8618 |
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.